Prediction model training method and device

By obtaining the answers to the questions, the word sequence in the inference text and fuses with the preset probability distribution, a richer fusion probability distribution is generated as a label, which solves the problem of single tag information for model training in the prior art, and improves the accuracy and effectiveness of the model.

CN119917632APending Publication Date: 2025-05-02CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510039766.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the prior art, the prediction probability distribution of the problem's answers is difficult to obtain in the model training process, resulting in a single label information, and the accuracy after model training is low.

Method used

By obtaining the answer to the question, reasoning the word sequence in the inference text, inputting it into the pre-trained model for word probability prediction, and fusing it with the preset probability distribution to generate a richer fusion probability distribution as a label, and then adjusting the model parameters through loss calculation.

Benefits of technology

The accuracy and effectiveness of the trained prediction model are improved, and the accuracy of the fusion probability distribution is improved and the model learns richer knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917632A_ABST
    Figure CN119917632A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a prediction model training method and device. The method comprises the steps that a word sequence composed of at least one word contained in an answer reasoning text of a question is obtained; inputting the word sequence and the question into a pre-training model for word probability prediction of adjacent word positions of the word sequence to obtain word probability distribution of the adjacent word positions for the reference word; performing fusion processing on the word probability distribution and preset probability distribution of the adjacent word positions for the reference word to obtain fusion probability distribution; and performing loss calculation according to the fusion probability distribution and the word probability distribution, and performing parameter adjustment on the pre-training model based on the calculated loss to obtain a word prediction model. According to the embodiment of the invention, the accuracy and effectiveness of the trained prediction model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data processing technology, and in particular to a prediction model training method and device. Background Art

[0002] With the continuous development of Internet technology and the continuous advancement of social information, more and more service scenarios are beginning to use models to generate answers to input questions, such as telephone customer service scenarios. Before using the model in actual application scenarios, it is often necessary to train the model so that the model meets the relevant needs of the actual application.

[0003] At present, since the predicted probability distribution of the answer to the input question is difficult to obtain, we can only use the standard answer text of the question as a label to fine-tune the model. It is impossible to use a more accurate predicted probability distribution as a label to perform refined training on the model, which makes the label information in the model training process relatively simple, resulting in low accuracy of the trained model. Summary of the invention

[0004] An object of one embodiment of the present specification is to provide a prediction model training method and apparatus to improve the accuracy and effectiveness of the trained prediction model.

[0005] To solve the above technical problems, an embodiment of this specification is implemented as follows: In a first aspect, an embodiment of the present specification provides a prediction model training method, the method comprising: Get the answer to the question Infer a word sequence consisting of at least one word contained in the text; Inputting the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Performing a fusion process on the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution; A loss is calculated according to the fusion probability distribution and the word probability distribution, and parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model.

[0006] The prediction model training method provided in this embodiment, after obtaining a word sequence consisting of at least one word contained in the inference text of the answer to the question, inputs the word sequence and the question into the pre-trained model to predict the word probability of the adjacent word positions of the word sequence, obtains the word probability distribution of the adjacent word positions for the reference word, and fuses the probability distribution of the word output by the pre-trained model and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution, thereby achieving smoothing of the preset probability distribution by integrating the preset probability distribution of the adjacent word positions output by the pre-trained model into the word probability distribution of the adjacent word positions, so that The smoothed fusion probability distribution is more suitable for the word probability distribution output by the pre-trained model, which improves the richness of the smoothed fusion probability distribution as a label; on this basis, the loss is calculated according to the fusion probability distribution and the word probability distribution, and the parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model. In this way, the loss is calculated by combining the smoothed fusion probability distribution and the word probability distribution output by the pre-trained model to improve the accuracy and effectiveness of the calculated loss. The parameters are adjusted through the loss, so that the pre-trained model can learn richer knowledge, thereby improving the accuracy and effectiveness of the trained word prediction model.

[0007] In a second aspect, another embodiment of the present specification provides a method for solving a problem, the method comprising: Get the predicted word sequence of the problem to be processed; Inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Determine the target word at the adjacent word position in the reference word based on the word probability distribution, and generate an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the question to be processed; Wherein, the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.

[0008] The prediction model training method provided in this embodiment obtains the predicted word sequence of the problem to be processed, then inputs the predicted word sequence and the problem to be processed into the word prediction model to predict the word probability of the adjacent word positions of the predicted word sequence, obtains the word probability distribution of the adjacent word positions for the benchmark word, selects the target word for the adjacent word position in the benchmark word with the help of the word probability distribution output by the word prediction model, and generates the answer inference text in combination with the target word and the predicted word sequence, and obtains the answer inference text of the problem to be processed; wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution; in this way, the preset probability distribution is smoothed by integrating the output word probability distribution into the preset probability distribution, the model parameters are adjusted according to the smoothed fused probability distribution to obtain the word prediction model, the accuracy and effectiveness of the word prediction model are improved, and then the accuracy and effectiveness of the answer inference text of the problem to be processed generated with the help of the word prediction model are improved.

[0009] In a third aspect, another embodiment of the present specification provides a prediction model training device, the device comprising: A word sequence acquisition module, used to acquire a word sequence consisting of at least one word contained in the answer inference text of the question; A word probability prediction module, used for inputting the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtain word probability distribution of the adjacent word positions for a reference word; A fusion processing module, used for fusing the word probability distribution and the preset probability distribution of the adjacent word position for the reference word to obtain a fused probability distribution; A loss calculation module is used to perform loss calculation according to the fusion probability distribution and the word probability distribution, and adjust the parameters of the pre-trained model based on the calculated loss to obtain a word prediction model.

[0010] In a fourth aspect, another embodiment of the present specification provides a problem handling device, the device comprising: A sequence acquisition module is used to obtain the predicted word sequence of the problem to be processed; A probability prediction module, used for inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtain word probability distribution of the adjacent word positions for a reference word; An answer generation module is used to determine the target word at the adjacent word position in the benchmark word based on the word probability distribution, and to generate an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the problem to be processed; wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.

[0011] In the fifth aspect, another embodiment of the present specification provides a prediction model training device, the device comprising: a memory, a processor, and computer executable instructions stored on the memory and executable on the processor, the computer executable instructions, when executed by the processor, implement the steps of the prediction model training method as described in the first aspect above.

[0012] In the sixth aspect, another embodiment of the present specification provides a problem handling device, the device comprising: a memory, a processor, and computer executable instructions stored on the memory and executable on the processor, the computer executable instructions, when executed by the processor, implement the steps of the problem handling method as described in the second aspect above.

[0013] In the seventh aspect, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the prediction model training method as described in the first aspect above are implemented.

[0014] In an eighth aspect, another embodiment of the present specification provides another computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the problem handling method described in the second aspect above are implemented.

[0015] In the ninth aspect, another embodiment of the present specification provides a computer program product, wherein the computer program product includes a call exception handling program, and the call exception handling program is executed by a processor to implement the steps of the prediction model training method as described in the first aspect above.

[0016] In the tenth aspect, another embodiment of the present specification provides another computer program product, wherein the computer program product includes a call exception handling program, and the call exception handling program is executed by a processor to implement the steps of the problem handling method as described in the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. Figure 1 A processing flow chart of a prediction model training method provided in one embodiment of this specification; Figure 2 A schematic diagram of a prediction model training process provided by one embodiment of this specification; Figure 3 A processing flow chart of a prediction model training method applied to a call scenario provided by one embodiment of this specification; Figure 4 A flowchart of a problem handling method provided for one embodiment of this specification; Figure 5 A flowchart of a problem handling method applied to a call scenario provided by an embodiment of this specification; Figure 6 A schematic diagram of a prediction model training device provided in one embodiment of this specification; Figure 7 A schematic diagram of a problem handling device provided in one embodiment of this specification; Figure 8 A schematic diagram of the structure of a prediction model training device provided in one embodiment of this specification; Fig. 9 A schematic diagram of the structure of a problem handling device provided in one embodiment of this specification. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0019] An embodiment of a prediction model training method provided in this specification is as follows: The prediction model training method provided in this embodiment can be executed by a computer device, which can be a terminal or a server, wherein the terminal can include a mobile phone, a laptop computer, an intelligent interactive device, etc., and the server can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.

[0020] Reference Figure 1 The prediction model training method provided in this embodiment specifically includes the following steps S102 to S108.

[0021] Step S102, obtaining a word sequence consisting of at least one word contained in the answer inference text of the question.

[0022] The question described in this embodiment refers to a question that requires answer reasoning, and the question can be a problem in any application scenario, such as a call customer service scenario, the question can be a question input by the user: At what time will the xx call package be removed from the shelves; for example, in a call anomaly detection scenario, the question can be a question input by the detection personnel for call anomaly detection. In addition, the question can also be a problem in other scenarios, such as mathematical reasoning problems, etc.; the question can be a reasoning problem.

[0023] The answer reasoning text of the question refers to the answer reasoning text obtained by reasoning the answer to the question; the answer reasoning text of the question may include the reasoning answer to the question and the answer reasoning path, which is also the answer reasoning process. The word sequence refers to a word sequence composed of one or more words contained in the answer reasoning text. The answer reasoning text of the question includes the standard answer reasoning text of the question, and the answer reasoning text of the question may specifically be a chain of thought (CoT). The question and the answer reasoning text of the question in this embodiment may constitute a training set; the training set includes one or more questions and the answer reasoning text of the question, that is, the question in this embodiment may be one or more, and the answer reasoning text of each question may also be one or more. The question and the answer reasoning text in this embodiment may constitute a training set.

[0024] In practical applications, large language models are more powerful and suitable for various tasks, including text generation, text classification, etc. However, the model scale of large language models is also large, and there are a large number of parameters, which leads to high computational costs and difficulty in deployment. To address this, in this embodiment, the cost of model deployment is reduced with the help of model compression technology, that is, knowledge distillation is performed on the pre-trained model with the help of a pre-trained answer reasoning model, so that the pre-trained model can have the relevant performance for answer reasoning to questions; the pre-trained model here can be a pre-trained student model.

[0025] Before performing knowledge distillation on the pre-trained model, that is, before performing model training, it is necessary to construct questions and answer reasoning texts of the questions, and perform model training on the pre-trained model through the questions and answer reasoning texts of the questions. In order to enable the pre-trained model to learn the answer reasoning texts of the questions, so that the pre-trained model has the ability to reason about the answers, the answer reasoning texts can be generated for the questions with the help of the pre-trained answer reasoning model; in an optional implementation manner provided in this embodiment, the answer reasoning text is obtained in the following manner: Inputting the question and the reasoning prompt text into a pre-trained answer reasoning model to perform answer reasoning processing to obtain a candidate answer reasoning text for the question; The candidate answer reasoning texts are screened to obtain the answer reasoning text of the question.

[0026] The inference prompt text includes text that prompts the pre-trained answer inference model to infer the answer to the question. The candidate answer inference texts for the question may be one or more. The pre-trained answer inference model may be a pre-trained teacher model, for example, the pre-trained answer inference model may be ChatGPT (Chat Generative Pre-trained Transformer, a large language model based on a generative pre-trained transformer architecture), GPT-4 (Generative Pre-trained Transformer-4, a fourth-generation generative pre-trained transformer model), etc.

[0027] Specifically, during the process of answer reasoning processing, the pre-trained answer reasoning model can generate multiple answer reasoning texts for the question based on the question and the reasoning prompt text as candidate answer reasoning texts for the question; for example, the pre-trained answer reasoning model parses the reasoning prompt text to obtain reasoning instructions, and after obtaining the reasoning instructions, generates multiple answer reasoning texts for the question according to the answer generation rules; the answer generation rules here can be a search algorithm, such as a beam search algorithm; in this way, the pre-trained answer reasoning model is used to generate multiple answer reasoning texts for each question as candidate answer reasoning texts, thereby improving the comprehensiveness and richness of the answer reasoning texts, and improving the convenience and coverage of answer reasoning by subsequent pre-trained models.

[0028] On this basis, since the candidate answer reasoning texts of the question may have candidate answer reasoning texts with low accuracy, effectiveness or other indicators, in order to improve the effectiveness and availability of the candidate answer reasoning texts of the question, in the first optional implementation mode provided by this embodiment, in the process of screening the candidate answer reasoning texts and obtaining the answer reasoning text of the question, the following operations are performed: Matching the inference answer contained in the candidate answer inference text with the preset inference answer to the question; The candidate answer reasoning text corresponding to the reasoning answer matching the preset reasoning answer is selected from the candidate answer reasoning texts as the answer reasoning text of the question.

[0029] The candidate answer reasoning text may include the reasoning answer to the question and the answer reasoning path. The preset reasoning answer to the question refers to the preset reasoning answer. For example, if the question is when will the xx phone bill package be removed from the shelves, the preset reasoning answer to the question is the removal time.

[0030] Specifically, since the question may be an open question or a closed question, such as a closed question such as when will xx phone charge package be removed from the shelves, and an open question such as please recommend me a phone charge package, in order to improve the accuracy of matching, the matching degree between the inference answer contained in the candidate answer inference text and the preset inference answer of the question can be calculated, and the answer inference text of the question can be determined in the candidate answer inference text based on the matching degree. Specifically, the candidate answer inference text corresponding to the inference answer whose matching degree with the preset inference answer is greater than the matching degree threshold can be screened out from the candidate answer inference text as the answer inference text of the question.

[0031] In addition, in the process of screening the candidate answer reasoning texts to obtain the answer reasoning text of the question, in order to ensure the diversity of the answer reasoning text of the question, that is, to avoid repeated answer reasoning texts in the answer reasoning text of the question, which causes waste of computing resources of the subsequent model, the overlap degree can be calculated based on the remaining answer reasoning texts in the candidate answer reasoning texts and the preset answer reasoning text of the question, and the answer reasoning text of the question can be determined in the candidate answer reasoning texts based on the overlap degree; specifically, in the second optional implementation manner provided by this embodiment, in the process of screening the candidate answer reasoning texts to obtain the answer reasoning text of the question, the following operations are performed: Calculate the overlap between the remaining answer reasoning texts in the candidate answer reasoning texts and the preset answer reasoning texts of the question; If the degree of overlap between the remaining answer inference text and any answer inference text in the preset answer inference text is greater than an overlap threshold, the preset answer inference text is used as the answer inference text for the question.

[0032] The overlap degree includes the overlap degree or similarity between the remaining answer reasoning text and the preset answer reasoning text of the question. For example, the overlap degree can be Optionally, the preset answer reasoning text of the question is determined and obtained in the candidate answer reasoning texts. The preset answer reasoning text of the question may be one or more. The remaining answer reasoning texts in the candidate answer reasoning texts may be answer reasoning texts that have not been overlapped in the candidate answer reasoning texts determined in order.

[0033] Furthermore, in an optional implementation manner provided by this embodiment, after calculating the overlap between the remaining answer inference text in the candidate answer inference text and the preset answer inference text of the question, the following operation is further performed: If the overlap is less than or equal to the overlap threshold, the remaining answer reasoning text and the preset answer reasoning text are used as the answer reasoning text for the question.

[0034] For example, the candidate answer reasoning text includes n answer reasoning texts, and the candidate answer reasoning text is , the preset answer reasoning text includes m answer reasoning texts, and the preset answer reasoning text of the question is , for each answer inference text in the candidate answer inference text , k=1, 2…n, calculate the reasoning text for each answer The overlap between the answer reasoning text and the preset answer reasoning text of the question. The overlap with any (any) answer inference text in the preset answer inference text of the question is greater than or equal to the overlap threshold , then Remove from the candidate answer reasoning text and continue to calculate the answer reasoning text Each answer reasoning text in the preset answer reasoning text of the question , … The overlap degree is calculated until the overlap degree is calculated for each answer reasoning text in the candidate answer reasoning text, and the final preset answer reasoning text of the question is obtained; If the above answer is inferred text The overlap with each answer inference text in the preset answer inference text of the question is less than or equal to the overlap threshold , then the answer inference text Merge into the default answer reasoning text of the question, that is, get the updated answer reasoning text of the question , and continue to calculate the answer reasoning text Each answer reasoning text in the preset answer reasoning text of the question , … The overlap is calculated for each answer inference text in the candidate answer inference texts, and the final answer inference text for the question is obtained.

[0035] It should be supplemented that the above-mentioned second optional implementation can be implemented on the basis of the first optional implementation, and the first optional implementation can also be implemented on the basis of the second optional implementation. This embodiment does not specifically limit the execution order of the first optional implementation and the second optional implementation.

[0036] It should be noted that after obtaining the candidate answer inference texts, during the first overlap calculation, since the preset answer inference text for the question has not yet been generated, that is, the preset answer inference text for the question is empty, any answer inference text can be selected from the candidate answer inference texts as the preset answer inference text for the question, and then the overlap is calculated based on the remaining answer inference texts in the candidate answer inference texts and the preset answer inference text for the question, and relevant operations of the candidates are performed based on the overlap; the remaining answer inference texts here are the answer inference texts other than any answer inference text in the candidate answer inference texts.

[0037] In a specific implementation, in order to improve the efficiency of model training for the pre-trained model and improve the effectiveness of model training for the pre-trained model, in an optional implementation provided by this embodiment, before executing the word sequence consisting of at least one word included in the inference text of the answer to the question, the following operation is also performed: The initial pre-trained model is fine-tuned according to the question and the answer inference text to obtain the pre-trained model.

[0038] Specifically, the question and answer inference text can be used as a training set to fine-tune the initial pre-trained model to obtain a pre-trained model; the initial pre-trained model can also be fine-tuned based on a training sample containing question and answer inference text to obtain a pre-trained model; the training sample here can include question and answer inference text, and can also include other questions and answer inference text of other questions.

[0039] In the process of fine-tuning the initial pre-trained model according to the question and the answer inference text to obtain the pre-trained model, a word sequence consisting of at least one word contained in the question and the answer inference text can be input into the initial pre-trained model to predict the word probability of adjacent word positions of the word sequence, obtain the word probability distribution of adjacent word positions for benchmark words, calculate the training loss according to the word probability distribution and the preset probability distribution of adjacent word positions for benchmark words, and adjust the parameters of the initial pre-trained model based on the training loss to obtain the pre-trained model.

[0040] Among them, the training loss can be a cross entropy loss or other types of losses. The above model fine-tuning process can be referred to, and the loss calculation and parameter adjustment can be iteratively performed according to the word probability distribution output by the initial pre-trained model until the loss function converges to obtain a pre-trained model. The adjacent word positions, word probability predictions, benchmark words, word probability distributions, etc. here are similar to the word probability predictions of the following pre-trained model and the word probability distributions of the adjacent word positions obtained for the benchmark words, and can be referred to the following detailed description.

[0041] During the specific execution process, a word sequence consisting of at least one word contained in the question and the answer reasoning text of the question may be obtained, and the at least one word may be a word sequence consisting of one or more words contained in the answer reasoning text of the question.

[0042] Step S104: input the word sequence and the question into a pre-trained model to predict the word probabilities of adjacent word positions of the word sequence, and obtain the word probability distribution of the adjacent word positions for the reference word.

[0043] The above-mentioned question and the answer to the question are inferred to contain at least one word sequence. In this step, the word sequence and the question are input into the pre-trained model to predict the word probability of adjacent word positions in the word sequence, and the word probability distribution of the adjacent word positions for the benchmark word is obtained, so as to realize the probability prediction of the next word in the word sequence through the pre-trained model.

[0044] The adjacent word position of this embodiment includes a position adjacent to a word sequence, which may be the next word position of the word sequence, that is, the next word position. The reference word includes a word in a vocabulary, that is, a word in a set consisting of one or more candidate words. The word probability distribution of the adjacent word position for the reference word includes the probability distribution of each word in the vocabulary corresponding to the adjacent word position, that is, the probability distribution of the word in the adjacent word position belonging to each word in the vocabulary.

[0045] The pre-trained model may be a pre-trained student model, and the pre-trained model may be a large language model, and specifically may be an autoregressive language model, such as an autoregressive model based on a Transformer architecture.

[0046] In specific implementation, the pre-trained model predicts the word probability of adjacent word positions in a word sequence based on the word sequence and the question, and in the process of obtaining the word probability distribution of the adjacent word positions for the benchmark word, the question can be parsed to obtain the parsing result, and the word probability of the next word position in the word sequence is predicted based on the parsing result and the word sequence, to obtain the word probability distribution of the next word position for each word in the vocabulary.

[0047] For example, the question is when will xx phone package be taken off the shelves. The question is parsed to obtain the parsing result to determine the time when xx phone package will be taken off the shelves. The current word sequence is "xx phone package". The word probability of the next word position in the word sequence is predicted based on the parsing result and the word sequence, and the word probability distribution of the next word position for each word in the word list is obtained, that is, the probability distribution of the next word in the predicted word sequence "xx phone package" belonging to the word list.

[0048] Step S106, fusing the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution.

[0049] In the above, the word sequence and the question are input into the pre-trained model to predict the word probability of the adjacent word positions of the word sequence, and the word probability distribution of the adjacent word positions for the benchmark word is obtained. In this step, the word probability distribution and the preset probability distribution of the adjacent word positions for the benchmark word are fused to obtain the fused probability distribution corresponding to the adjacent word positions, so as to improve the richness of the fused probability distribution corresponding to the adjacent word positions by fusing the word probability distribution and the preset probability distribution.

[0050] The preset probability distribution described in this embodiment includes the actual probability distribution of the adjacent word position of the word sequence for the benchmark word; the preset probability distribution may be a preset probability label, which may specifically be a one-hot vector. For example, the preset word corresponding to the adjacent word position is "I", and the position of "I" in the word list is the first. Then, in the preset probability distribution of the adjacent word position for the benchmark word, the probability corresponding to "I" is 1, and the probability of the other benchmark words is 0, that is, the preset probability distribution of the adjacent word position for the benchmark word is [1, 0, 0, 0, 0…0].

[0051] In practical applications, if the loss is directly calculated based on the word probability distribution output by the pre-trained model and the preset probability distribution of the adjacent word positions for the benchmark words, and then the parameters are adjusted, it may lead to poor learning effect of the pre-trained model. To this end, in order to improve the learning effect of the pre-trained model, the richness of the preset probability distribution of the adjacent word positions for the benchmark words is improved; the word probability distribution and the preset probability distribution of the adjacent word positions for the benchmark words can be fused to obtain a fused probability distribution. Specifically, the word probability distribution of the adjacent word positions for the benchmark words and the preset probability distribution of the adjacent word positions for the benchmark words can be input into the fusion algorithm for fusion processing to obtain a fused probability distribution; For example, fusion algorithms include:

[0052] in, represents the hyperparameter, It can be a pre-set hyperparameter; represents the preset probability distribution of the adjacent word positions for the reference word; represents the word probability distribution of the neighboring word positions for the reference word; Represents the fusion probability distribution.

[0053] For example, Figure 2 As shown, the answer to the question inference text contains a word sequence consisting of { }, the question and the word sequence { } Input the pre-trained model Transformer, Transformer outputs the word probability distribution of the adjacent word positions of the word sequence for the benchmark word , the preset probability distribution of the adjacent word positions for the benchmark word is , the word probability distribution and the preset probability distribution of the adjacent word position for the benchmark word are fused to obtain the fused probability distribution .

[0054] Step S108, performing loss calculation according to the fusion probability distribution and the word probability distribution, and adjusting parameters of the pre-trained model based on the calculated loss to obtain a word prediction model.

[0055] The above-mentioned word probability distribution and the preset probability distribution of the adjacent word position for the benchmark word are fused to obtain a fused probability distribution. In this step, the loss is calculated according to the fused probability distribution and the word probability distribution, and the parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model, so as to improve the comprehensiveness and accuracy of the loss by calculating the loss through the fused probability distribution.

[0056] In a specific implementation, in the process of calculating the loss according to the fused probability distribution and the word probability distribution, a similarity index of the fused probability distribution and the word probability distribution may be calculated, and the similarity index may be used as the loss obtained by calculation; wherein the similarity index may be a divergence value, specifically a KL (Kullback-Leibler Divergence) divergence; or, the fused probability distribution and the word probability distribution may be input into a loss function to calculate the loss and obtain the loss; For example, loss functions include:

[0057] in, represents loss; represents the fusion probability distribution; Represents word probability distribution.

[0058] In specific implementation, after the loss is calculated, the parameters of the pre-trained model can be adjusted based on the loss, and the answer inference text can continue to obtain a word sequence composed of at least one word after the word and at least one word, and the question and the word sequence are input into the pre-trained model for word probability prediction, fusion processing, loss calculation, and parameter adjustment. That is, referring to the above-mentioned model training process, the model is iteratively trained until the loss function converges to obtain a word prediction model.

[0059] In practical applications, the effects of the pre-trained model on word probability prediction for questions and answer reasoning texts may be different. For example, the credibility of the pre-trained model in predicting word probabilities for some answer reasoning texts is higher, and the credibility of the pre-trained model in predicting word probabilities for some answer reasoning texts is lower. In view of this, after the word prediction model is trained, the model training may be a training that completes a preset number of steps, and the word prediction model is verified through a verification set. The target answer reasoning text is determined in the answer reasoning text of the question through the verification result, and the loss weight corresponding to the target answer reasoning text in the loss function is adjusted, and then the word prediction model is trained according to the adjusted loss function. In an optional implementation manner provided by this embodiment, after the loss is calculated according to the fused probability distribution and the word probability distribution, and the parameters of the pre-trained model are adjusted based on the calculated loss to obtain the execution of the word prediction model, the following operations are also performed: Performing verification processing on the word prediction model based on a verification set, obtaining a total probability distribution corresponding to each answer inference text of the verification set, and determining a target answer inference text in the answer inference text based on the total probability distribution; The loss weight corresponding to the target answer inference text in the loss function is adjusted upward, and the word prediction model is trained according to the adjustment result and the training set consisting of the question and the answer inference text.

[0060] The validation set includes one or more validation data, which are composed of question and answer reasoning texts. The total probability distribution corresponding to any answer reasoning text in the answer reasoning texts includes the combined probability distribution obtained by combining the word probability distributions of each word position of the answer reasoning text output by the word prediction model. For example, the training set uses Indicates that the validation set uses The upward adjustment process includes upward adjustment or increase of the loss weight. The loss function includes the loss function of the word prediction model.

[0061] Specifically, in the process of training the word prediction model based on the up-adjustment result and the training set consisting of the question and the answer inference text, the up-adjustment result can be used as a loss function, and the word prediction model can be trained with the training set consisting of the question and the answer inference text as a sample.

[0062] It should be noted that the process of verification processing, determining the target answer inference text, performing up-regulation processing, and performing model training can be performed once or multiple times, and this embodiment does not limit this.

[0063] On this basis, in an optional implementation manner provided by this embodiment, in the process of determining the target answer inference text in the answer inference text based on the total probability distribution, the following operations are performed: Calculate the evaluation index corresponding to each answer reasoning text based on the total probability distribution; The answer reasoning text is screened according to the evaluation index to obtain the target answer reasoning text.

[0064] Among them, the evaluation index corresponding to each answer reasoning text can be the model generation probability corresponding to each answer reasoning text; the model generation probability can be the log-likelihood result of the total probability distribution of each answer reasoning text.

[0065] Furthermore, in order to determine the answer reasoning text that is difficult for the word prediction model to learn in the answer reasoning text of the question, so that the subsequent word prediction model can increase the attention to the answer reasoning text that is difficult to learn, and improve the word prediction effect of the word prediction model on the answer reasoning text that is difficult to learn; in an optional implementation manner provided by this embodiment, in the process of screening the reasoning text in the answer reasoning text according to the evaluation index and obtaining the target answer reasoning text, the following operations are performed: Sorting the evaluation indicators, and determining the answer reasoning text corresponding to the evaluation indicators whose sorting positions are after the preset positions from the sorting results; The similarity between the answer reasoning text corresponding to the evaluation index and the answer reasoning text of the training set is calculated, and the target answer reasoning text is screened out from the answer reasoning text of the training set based on the similarity.

[0066] For example, the model generation probability of each answer inference text is sorted, and the answer inference texts corresponding to p model generation probabilities whose sorting positions are after a preset position are determined from the sorting results, and the similarity between the answer inference text and the answer inference text in the training set is calculated. Based on the similarity, h target answer inference texts are screened out from the answer inference texts in the training set. Specifically, the similarity can be sorted, and the target answer inference texts corresponding to h similarities whose sorting positions are before a second preset position are determined in the sorting results.

[0067] In practical applications, after obtaining a word prediction model, or after obtaining a trained word prediction model by model training the word prediction model according to the up-adjustment result and a training set consisting of the question and the answer inference text, the word prediction model and the trained word prediction model can be applied in actual scenarios; specifically, after the loss is calculated according to the fusion probability distribution and the word probability distribution, and the parameters of the pre-trained model are adjusted based on the calculated loss to obtain the word prediction model, the following operations can also be performed: Get the predicted word sequence of the problem to be processed; Inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; The target word at the adjacent word position is determined in the reference word based on the word probability distribution, and an answer is generated based on the predicted word sequence and the target word to obtain an answer reasoning text for the problem to be processed.

[0068] Optionally, the word prediction model is obtained after adjusting model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution; the word probability distribution output here can be the word probability distribution output by the pre-trained model.

[0069] Among them, the pending problems refer to problems that require answer reasoning. The pending problems can be problems in any application scenario. For example, in a call customer service scenario, the pending problems can be pending problems input by the user: At what time will the xx call package be removed from the shelves? For example, in a call anomaly detection scenario, the pending problems can be problems input by the detection personnel for call anomaly detection. In addition, the pending problems can also be problems in other scenarios, such as mathematical reasoning problems, etc.; the pending problems can be reasoning problems.

[0070] The predicted word sequence of the problem to be processed includes a word sequence for generating an answer to the problem to be processed, and the predicted word sequence may be a partial predicted word sequence, that is, the process of generating an answer to the problem to be processed has not been completed. The answer generation may be answer reasoning.

[0071] Specifically, in the process of determining the target word of the adjacent word position in the benchmark word based on the word probability distribution, the word with the highest probability in the word probability distribution can be determined as the target word of the adjacent word position, or the target word of the adjacent word position can be obtained by randomly sampling in the benchmark word based on the word probability distribution, or the word probability distribution can be adjusted by the temperature parameter to obtain an updated word probability distribution, and the target word of the adjacent word position can be determined in the benchmark word based on the updated word probability distribution; in the process of generating an answer based on the predicted word sequence and the target word to obtain the answer reasoning text of the problem to be processed, the target word can be written into the predicted word sequence to obtain an updated predicted word sequence, and then the updated predicted word sequence is used as the predicted word sequence, and the operation of inputting the predicted word sequence and the problem to be processed into the word prediction model to perform word probability prediction of the adjacent word position of the predicted word sequence, obtaining the word probability distribution of the adjacent word position for the benchmark word, and determining the target word of the adjacent word position in the benchmark word based on the word probability distribution, until the complete predicted word sequence is obtained as the answer reasoning text of the text to be processed.

[0072] It should be supplemented that each optional implementation method or each feasible execution method in steps S102 to S108 provided in this embodiment can be executed independently as needed, or can be combined and referenced with each other. At the same time, each specific execution step in each optional implementation method or each feasible execution method can also be executed independently, and this embodiment does not make specific limitations.

[0073] In summary, the prediction model training method provided in this embodiment first obtains a word sequence consisting of at least one word contained in the answer inference text of the question, and then inputs the word sequence and the question into the pre-trained model to predict the word probability of the adjacent word positions of the word sequence, obtains the word probability distribution of the adjacent word positions for the reference word, and fuses the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain the fused probability distribution, thereby integrating the preset probability distribution of the adjacent word positions output by the pre-trained model into the preset probability distribution of the adjacent word positions to achieve smoothing of the preset probability distribution, so that the smoothed fused probability distribution is more adapted to the word probability distribution output by the pre-trained model, and improves the richness of the smoothed fused probability distribution as a label; Thirdly, the loss is calculated based on the fusion probability distribution and the word probability distribution, and the parameters of the pre-trained model are adjusted based on the calculated loss to obtain the word prediction model, the word prediction model is verified based on the verification set, the total probability distribution corresponding to each answer inference text in the verification set is obtained, and the target answer inference text is determined in the answer inference text based on the total probability distribution, the loss weight corresponding to the target answer inference text in the loss function is adjusted upward, and the word prediction model is trained based on the adjusted result and the training set consisting of the question and answer inference text, so as to determine the target answer inference text in the answer inference text through the total probability distribution to identify the target answer inference text that is more difficult to learn in the answer inference text of the question, and by increasing the loss weight of the target answer inference text in the loss function, the word prediction model's learning attention to the target answer inference text is increased, which can better learn the target answer inference text and improve the model performance of the word prediction model.

[0074] The following combination Figure 3 , taking the application of the prediction model training method provided by this embodiment in a call scenario as an example, the prediction model training method provided by this embodiment is further described. Figure 3 ,The prediction model training method applied to the call scenario specifically includes the following steps.

[0075] Step S302: Obtain a word sequence consisting of at least one word contained in the inference text of the answer to the call question.

[0076] Step S304, input the word sequence and the conversation question into the pre-trained model to predict the word probability of the adjacent word positions of the word sequence, and obtain the word probability distribution of the adjacent word positions for each word in the vocabulary.

[0077] Step S306, fusing the word probability distribution and the preset probability distribution of the adjacent word positions for each word in the vocabulary to obtain a fused probability distribution.

[0078] Step S308, performing loss calculation according to the fusion probability distribution and the word probability distribution, and adjusting parameters of the pre-trained model based on the calculated loss to obtain a word prediction model.

[0079] Step S310, verify the word prediction model based on the verification set to obtain the total probability distribution corresponding to each answer inference text in the verification set.

[0080] Step S312, calculating the evaluation index corresponding to each answer reasoning text based on the total probability distribution, sorting the evaluation index, and determining the answer reasoning text corresponding to the evaluation index whose sorting position is after the preset position from the sorting result.

[0081] Step S314, calculating the similarity between the corresponding answer reasoning text and the answer reasoning text, and filtering out the target answer reasoning text from the answer reasoning text based on the similarity.

[0082] Step S316, the loss weight corresponding to the target answer inference text in the loss function is adjusted upward, and the word prediction model is trained according to the adjustment result and the call question and answer inference text.

[0083] It should be noted that any one of steps S302 to S316 or any combination of multiple steps can be replaced by the corresponding technical means provided in the above steps S102 to S108 according to the needs of implementation and deployment, and will not be described one by one here.

[0084] It should be supplemented that, when reading the prediction model training method provided in the above embodiment, you can refer to the relevant content of the problem handling method provided in the following embodiment. Correspondingly, when reading the problem handling method provided in the following embodiment, you can refer to the relevant content of the prediction model training method provided in the above embodiment.

[0085] An embodiment of a problem solving method provided in this specification is as follows: The problem handling method provided in this embodiment can be executed by a computer device, which can be a terminal or a server. The terminal can include a mobile phone, a laptop computer, an intelligent interactive device, etc., and the server can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.

[0086] Reference Figure 4 The problem handling method provided in this embodiment specifically includes the following steps S402 to S406.

[0087] Step S402: Obtain a predicted word sequence for the question to be processed.

[0088] The pending problems in this embodiment refer to problems that require answer reasoning. The pending problems can be problems in any application scenario. For example, in a call customer service scenario, the pending problems can be problems input by the user: At what time will the xx call fee package be removed from the shelves? For example, in a call anomaly detection scenario, the pending problems can be problems input by the detection personnel for call anomaly detection. In addition, the pending problems can also be problems in other scenarios, such as mathematical reasoning problems, etc.; the pending problems can be reasoning problems.

[0089] The predicted word sequence of the problem to be processed includes a word sequence for generating an answer to the problem to be processed, and the predicted word sequence may be a partial predicted word sequence, that is, a word sequence that has not yet completed the process of generating an answer to the problem to be processed. The answer generation may be answer reasoning.

[0090] Step S404: input the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtain word probability distribution of the adjacent word positions for the reference word.

[0091] Optionally, the word prediction model is obtained after adjusting model parameters based on a fused probability distribution; the fused probability distribution is obtained after fusing a preset probability distribution and an output word probability distribution.

[0092] The specific execution process of the word prediction model here predicting the word probability of adjacent word positions of the predicted word sequence based on the predicted word sequence and the problem to be processed is similar to the implementation process of the pre-trained model predicting the word probability of adjacent word positions of the word sequence based on the word sequence and the problem in the above embodiment. Please refer to it for reading, and this embodiment will not be repeated here.

[0093] Step S406, determining the target word at the adjacent word position in the reference word based on the word probability distribution, and generating an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the question to be processed.

[0094] In a specific implementation, in the process of determining the target word of the adjacent word position in the benchmark word based on the word probability distribution, the word with the highest probability in the word probability distribution can be determined as the target word of the adjacent word position, or the target word of the adjacent word position can be obtained by randomly sampling the benchmark word based on the word probability distribution, or the word probability distribution can be adjusted by a temperature parameter to obtain an updated word probability distribution, and the target word of the adjacent word position can be determined in the benchmark word based on the updated word probability distribution.

[0095] In the process of generating an answer based on the predicted word sequence and the target word to obtain the answer reasoning text of the problem to be processed, the target word can be written into the predicted word sequence to obtain an updated predicted word sequence, and then the updated predicted word sequence is used as the predicted word sequence, and the execution of steps 402 to S406 is returned until a complete predicted word sequence is obtained as the answer reasoning text of the text to be processed.

[0096] It should be supplemented that each optional implementation method or each feasible execution method in steps S402 to S406 provided in this embodiment can be executed independently as needed, or can be combined and referenced with each other. At the same time, each specific execution step in each optional implementation method or each feasible execution method can also be executed independently, and this embodiment does not make specific limitations.

[0097] The following combination Figure 5 , taking the application of the problem handling method provided by this embodiment in a call scenario as an example, the problem handling method provided by this embodiment is further explained. Figure 5 ,The problem handling method applied to the call scenario specifically includes the following steps.

[0098] Step S502: Obtain a predicted word sequence for a call question to be processed.

[0099] Step S504, input the predicted word sequence and the call question into the word prediction model to predict the word probability of the adjacent word positions of the predicted word sequence, and obtain the word probability distribution of the adjacent word positions for each word in the vocabulary.

[0100] Step S506, determining the target word at the adjacent word position in each word based on the word probability distribution.

[0101] Step S508, generate an answer based on the predicted word sequence and the target word to obtain an answer inference text of the call question.

[0102] It should be noted that any one of steps S502 to S508 or any combination of multiple steps can be replaced by the corresponding technical means provided in the above steps S402 to S406 according to the needs of implementation and deployment, and will not be described one by one here.

[0103] Figure 6 A schematic diagram of a prediction model training device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the device comprises: A word sequence acquisition module 602 is used to acquire a word sequence consisting of at least one word contained in the answer inference text of the question; A word probability prediction module 604 is used to input the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtain word probability distribution of the adjacent word positions for a reference word; A fusion processing module 606 is used to perform fusion processing on the word probability distribution and the preset probability distribution of the adjacent word position for the reference word to obtain a fused probability distribution; The loss calculation module 608 is used to calculate the loss according to the fusion probability distribution and the word probability distribution, and adjust the parameters of the pre-trained model based on the calculated loss to obtain a word prediction model.

[0104] The prediction model training device provided in this embodiment firstly obtains a word sequence consisting of at least one word contained in the answer inference text of the question by running the word sequence acquisition module 602, runs the word probability prediction module 604, inputs the word sequence and the question into the pre-trained model to predict the word probability of the adjacent word positions of the word sequence, and obtains the word probability distribution of the adjacent word positions for the benchmark word, then runs the fusion processing module 606 to fuse the word probability distribution and the preset probability distribution of the adjacent word positions for the benchmark word to obtain the fused probability distribution, and finally runs the loss calculation module 608 to calculate the loss according to the fused probability distribution and the word probability distribution, and adjusts the parameters of the pre-trained model based on the calculated loss to obtain the word prediction model, so as to improve the accuracy and effectiveness of the trained prediction model.

[0105] The prediction model training device provided in one embodiment of this specification can implement each process in the method embodiment of the aforementioned prediction model training method and achieve the same functions and effects, which will not be repeated here.

[0106] Figure 7 A schematic diagram of a problem handling device provided by another embodiment of the present invention is shown as follows: Figure 7 As shown, the device comprises: A sequence acquisition module 702, used to acquire a predicted word sequence of a problem to be processed; A probability prediction module 704 is used to input the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtain word probability distribution of the adjacent word positions for the reference word; The answer generation module 706 is used to determine the target word at the adjacent word position in the benchmark word based on the word probability distribution, and generate an answer based on the predicted word sequence and the target word to obtain the answer reasoning text of the problem to be processed; wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.

[0107] The problem processing device provided in this embodiment first obtains the predicted word sequence of the problem to be processed by running the sequence acquisition module 702; runs the probability prediction module 704, inputs the predicted word sequence and the problem to be processed into the word prediction model to predict the word probability of the adjacent word positions of the predicted word sequence, and obtains the word probability distribution of the adjacent word positions for the benchmark word; runs the answer generation module 706, determines the target word of the adjacent word position in the benchmark word based on the word probability distribution, and generates an answer based on the predicted word sequence and the target word, and obtains the answer reasoning text of the problem to be processed; wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution, so as to improve the accuracy and effectiveness of the answer reasoning text of the problem to be processed.

[0108] A problem handling device provided in one embodiment of this specification can implement each process in the method embodiment of the aforementioned problem handling method and achieve the same functions and effects, which will not be repeated here.

[0109] Furthermore, an embodiment of the present specification also provides a prediction model training device, Figure 8 A schematic diagram of a prediction model training device provided in an embodiment of this specification is shown in FIG. Figure 8 As shown, the device includes: a memory 801, a processor 802, a bus 803 and a communication interface 804. The memory 801, the processor 802 and the communication interface 804 communicate through the bus 803, and the communication interface 804 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.

[0110] Figure 8 In the embodiment, the memory 801 stores computer executable instructions that can be run on the processor 802, and when the computer executable instructions are executed by the processor 802, the following process is implemented: Get the answer to the question Infer a word sequence consisting of at least one word contained in the text; Inputting the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Performing a fusion process on the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution; A loss is calculated according to the fusion probability distribution and the word probability distribution, and parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model.

[0111] The prediction model training device provided in this embodiment, through the cooperation of the memory 801, the processor 802, the bus 803 and the communication interface 804, obtains a word sequence consisting of at least one word contained in the answer inference text of the question, and then inputs the word sequence and the question into the pre-trained model to predict the word probability of adjacent word positions of the word sequence, obtains the word probability distribution of the adjacent word positions for the benchmark words, fuses the word probability distribution and the preset probability distribution of the adjacent word positions for the benchmark words to obtain the fused probability distribution, calculates the loss according to the fused probability distribution and the word probability distribution, and adjusts the parameters of the pre-trained model based on the calculated loss to obtain a word prediction model, so as to improve the accuracy and effectiveness of the trained prediction model.

[0112] The prediction model training device provided in one embodiment of this specification can implement each process in the method embodiment of the aforementioned prediction model training method and achieve the same functions and effects, which will not be repeated here.

[0113] An embodiment of this specification also provides a problem handling device, Fig. 9 A schematic diagram of a problem handling device provided in an embodiment of this specification is shown in FIG. Fig. 9 As shown, the device includes: a memory 901, a processor 902, a bus 903 and a communication interface 904. The memory 901, the processor 902 and the communication interface 904 communicate through the bus 903, and the communication interface 904 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.

[0114] Fig. 9 In the embodiment, the memory 901 stores computer executable instructions that can be run on the processor 902. When the computer executable instructions are executed by the processor 902, the following process is implemented: Get the predicted word sequence of the problem to be processed; Inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Determine the target word at the adjacent word position in the reference word based on the word probability distribution, and generate an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the question to be processed; Wherein, the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.

[0115] The problem processing device provided in this embodiment obtains the predicted word sequence of the problem to be processed through the cooperation of the memory 901, the processor 902, the bus 903 and the communication interface 904, and then inputs the predicted word sequence and the problem to be processed into the word prediction model to predict the word probability of the adjacent word positions of the predicted word sequence, obtain the word probability distribution of the adjacent word positions for the reference word, determine the target word of the adjacent word position in the reference word based on the word probability distribution, and generate the answer based on the predicted word sequence and the target word to obtain the answer reasoning text of the problem to be processed, wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution; thereby improving the accuracy and effectiveness of the answer reasoning text of the problem to be processed.

[0116] A problem handling device provided in an embodiment of this specification can implement each process in the method embodiment of the aforementioned problem handling method and achieve the same functions and effects, which will not be repeated here.

[0117] Furthermore, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented: Get the answer to the question Infer a word sequence consisting of at least one word contained in the text; Inputting the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Performing a fusion process on the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution; A loss is calculated according to the fusion probability distribution and the word probability distribution, and parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model.

[0118] The computer-readable storage medium provided in this embodiment obtains a word sequence consisting of at least one word contained in the answer inference text of the question, then inputs the word sequence and the question into a pre-trained model to predict the word probability of adjacent word positions of the word sequence, obtains the word probability distribution of the adjacent word positions for the benchmark words, fuses the word probability distribution and the preset probability distribution of the adjacent word positions for the benchmark words to obtain a fused probability distribution, calculates the loss based on the fused probability distribution and the word probability distribution, and adjusts the parameters of the pre-trained model based on the calculated loss to obtain a word prediction model, so as to improve the accuracy and effectiveness of the trained prediction model.

[0119] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0120] A computer-readable storage medium provided in one embodiment of this specification can implement each process in the method embodiment of the aforementioned pre-trained model training method and achieve the same functions and effects, which will not be repeated here.

[0121] Another embodiment of the present specification also provides another computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented: Get the predicted word sequence of the problem to be processed; Inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Determine the target word at the adjacent word position in the reference word based on the word probability distribution, and generate an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the question to be processed; Wherein, the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.

[0122] The computer-readable storage medium provided in this embodiment obtains a predicted word sequence for the problem to be processed, then inputs the predicted word sequence and the problem to be processed into a word prediction model to predict the word probability of adjacent word positions of the predicted word sequence, obtains the word probability distribution of the adjacent word positions for the benchmark word, determines the target word of the adjacent word position in the benchmark word based on the word probability distribution, and generates an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the problem to be processed, wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution; thereby improving the accuracy and effectiveness of the answer reasoning text for the problem to be processed.

[0123] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0124] Another computer-readable storage medium provided in an embodiment of this specification can implement each process in the method embodiment of the aforementioned problem handling method and achieve the same functions and effects, which will not be repeated here.

[0125] Furthermore, another embodiment of the present specification also provides a computer program product, which implements the following process when executed by a processor: Get the answer to the question Infer a word sequence consisting of at least one word contained in the text; Inputting the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Performing a fusion process on the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution; A loss is calculated according to the fusion probability distribution and the word probability distribution, and parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model.

[0126] The computer program product provided by this embodiment, after obtaining a word sequence consisting of at least one word contained in the inference text of the answer to the question, inputs the word sequence and the question into a pre-trained model to predict the word probability of adjacent word positions in the word sequence, obtains the word probability distribution of the adjacent word positions for the benchmark words, fuses the word probability distribution and the preset probability distribution of the adjacent word positions for the benchmark words to obtain a fused probability distribution, calculates the loss based on the fused probability distribution and the word probability distribution, and adjusts the parameters of the pre-trained model based on the calculated loss to obtain a word prediction model, so as to improve the accuracy and effectiveness of the trained prediction model.

[0127] A computer program product provided in one embodiment of this specification can implement each process in the method embodiment of the aforementioned prediction model training method and achieve the same functions and effects, which will not be repeated here.

[0128] Another embodiment of the present specification also provides another computer program product, which implements the following process when executed by a processor: Get the predicted word sequence of the problem to be processed; Inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Determine the target word at the adjacent word position in the reference word based on the word probability distribution, and generate an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the question to be processed; Wherein, the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.

[0129] The computer program product provided by this embodiment, after obtaining the predicted word sequence of the problem to be processed, inputs the predicted word sequence and the problem to be processed into the word prediction model to predict the word probability of the adjacent word positions of the predicted word sequence, obtains the word probability distribution of the adjacent word positions for the benchmark word, determines the target word of the adjacent word position in the benchmark word based on the word probability distribution, and generates the answer based on the predicted word sequence and the target word to obtain the answer reasoning text of the problem to be processed, wherein the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution; thereby improving the accuracy and effectiveness of the answer reasoning text of the problem to be processed.

[0130] Another computer program product provided in one embodiment of this specification can implement each process in the method embodiment of the aforementioned problem handling method and achieve the same functions and effects, which will not be repeated here.

[0131] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

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

[0136] Memory may include non-permanent storage in a computer-readable storage medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable storage medium.

[0137] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0139] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0140] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A prediction model training method, characterized in that: The method comprises: Get the answer to the question Infer a word sequence consisting of at least one word contained in the text; Inputting the word sequence and the question into a pre-trained model to perform word probability prediction of adjacent word positions of the word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Performing a fusion process on the word probability distribution and the preset probability distribution of the adjacent word positions for the reference word to obtain a fused probability distribution; A loss is calculated according to the fusion probability distribution and the word probability distribution, and parameters of the pre-trained model are adjusted based on the calculated loss to obtain a word prediction model.

2. The prediction model training method according to claim 1, characterized in that: The answer reasoning text is obtained in the following way: Inputting the question and the reasoning prompt text into a pre-trained answer reasoning model to perform answer reasoning processing to obtain a candidate answer reasoning text for the question; The candidate answer reasoning texts are screened to obtain the answer reasoning text of the question.

3. The prediction model training method according to claim 2, characterized in that: The screening process of the candidate answer reasoning text to obtain the answer reasoning text of the question includes: Matching the inference answer contained in the candidate answer inference text with the preset inference answer to the question; The candidate answer reasoning text corresponding to the reasoning answer matching the preset reasoning answer is screened out from the candidate answer reasoning texts as the answer reasoning text of the question.

4. The prediction model training method according to claim 2, characterized in that: The screening process of the candidate answer reasoning text to obtain the answer reasoning text of the question includes: Calculate the overlap between the remaining answer reasoning texts in the candidate answer reasoning texts and the preset answer reasoning texts of the question; If the degree of overlap between the remaining answer inference text and any answer inference text in the preset answer inference text is greater than an overlap threshold, the preset answer inference text is used as the answer inference text for the question.

5. The prediction model training method according to claim 4, characterized in that: After the sub-step of calculating the overlap degree based on the remaining answer inference texts in the candidate answer inference texts and the preset answer inference texts of the question is executed, the method further includes: If the overlap is less than or equal to the overlap threshold, the remaining answer reasoning text and the preset answer reasoning text are used as the answer reasoning text for the question.

6. The prediction model training method according to claim 1, characterized in that: After the step of calculating the loss according to the fusion probability distribution and the word probability distribution, and adjusting the parameters of the pre-trained model based on the calculated loss to obtain the word prediction model is executed, the method further includes: Performing verification processing on the word prediction model based on a verification set, obtaining a total probability distribution corresponding to each answer inference text of the verification set, and determining a target answer inference text in the answer inference text based on the total probability distribution; The loss weight corresponding to the target answer inference text in the loss function is adjusted upward, and the word prediction model is trained according to the adjustment result and the training set consisting of the question and the answer inference text.

7. The prediction model training method according to claim 6, characterized in that: The determining a target answer inference text in the answer inference text based on the total probability distribution includes: Calculate the evaluation index corresponding to each answer reasoning text based on the total probability distribution; The answer reasoning text is screened according to the evaluation index to obtain the target answer reasoning text.

8. The prediction model training method according to claim 7, characterized in that: The step of screening the answer reasoning text according to the evaluation index to obtain the target answer reasoning text comprises: Sorting the evaluation indicators, and determining the answer reasoning text corresponding to the evaluation indicators whose sorting positions are after the preset positions from the sorting results; The similarity between the answer reasoning text corresponding to the evaluation index and the answer reasoning text of the training set is calculated, and the target answer reasoning text is screened out from the answer reasoning text of the training set based on the similarity.

9. The prediction model training method according to claim 1, characterized in that: Before the step of obtaining the word sequence consisting of at least one word contained in the inference text of the answer to the question is executed, the method further includes: The initial pre-trained model is fine-tuned according to the question and the answer inference text to obtain the pre-trained model.

10. A problem solving method, characterized in that: The method comprises: Get the predicted word sequence of the problem to be processed; Inputting the predicted word sequence and the problem to be processed into a word prediction model to perform word probability prediction of adjacent word positions of the predicted word sequence, and obtaining word probability distribution of the adjacent word positions for a reference word; Determine the target word at the adjacent word position in the reference word based on the word probability distribution, and generate an answer based on the predicted word sequence and the target word to obtain an answer reasoning text for the question to be processed; Wherein, the word prediction model is obtained after adjusting the model parameters based on the fused probability distribution; the fused probability distribution is obtained after fusing the preset probability distribution and the output word probability distribution.