User consultation question recommendation method, system, computer device and storage medium

By using the prompt encoder trained by the historical user consultation problem and the first text prediction model, continuous prompt encoding information is generated, combined with the prefix text input by the user, the input sequence is determined, and the first text prediction model is used to predict the candidate problem set, the problem of low prediction accuracy of user consultation problem in the prior art is solved, and efficient and accurate identification and reply to user consultation intentions is achieved.

CN114138954BActive Publication Date: 2025-04-11泰康保险集团股份有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111385315.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2025-04-11
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

In the prior art, artificial intelligence natural language processing has low accuracy when predicting user consultation problems, and cannot accurately identify user consultation intentions.

Method used

By using the prompt encoder obtained by using the historical user consultation questions and the first text prediction model training, continuous prompt encoding information is generated, combined with the prefix text input by the user, the input sequence is determined, and the first text prediction model is used to predict the candidate problem set. Further, the candidate questions are scored through the text scoring model, the candidate questions in the top score Y are selected, and the corresponding knowledge points are output.

Benefits of technology

It improves the accuracy of user consultation questions prediction, can recommend the knowledge points that users are most likely to consult in real time, enhances the efficiency and accuracy of intelligent answers, and improves the accuracy of user consultation intention responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114138954B_ABST
    Figure CN114138954B_ABST
Patent Text Reader

Abstract

This paper provides a method, system, computer device and storage medium for recommending user consultation questions. The method includes: determining an input sequence according to continuous prompt coding information and prefix text input by the user, wherein the continuous prompt coding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained using historical user consultation questions and a first text prediction model; predicting a candidate question set according to the input sequence and the first text prediction model; and outputting the knowledge points corresponding to the candidate question set to the user. This paper can automatically, reasonably and comprehensively generate continuous prompt coding information suitable for personalized scenarios, predict user consultation questions using continuous prompt coding information and prefix information input by the user, standardize personalized user consultation question prediction tasks, recommend the knowledge points that users are most likely to consult in real time, efficiently and intelligently answer user consultation questions, and improve the accuracy of user consultation intention replies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to the field of artificial intelligence natural language processing, and in particular to a method, system, computer device and storage medium for recommending user consultation questions. Background Art

[0002] In the prior art, when people interact with machines, people mainly input consultation information, and the machine performs semantic matching based on the consultation information, and then determines the reply content based on the semantics and responds.

[0003] However, because the consulting information input by people is non-standard and the content of the consultation is relatively random, the robot will not be able to accurately perform semantic matching, which will lead to the problem that the consulting information cannot be responded to.

[0004] The existing solution to the problem of irregularity and randomness in human input consultation questions is to directly use the existing text prediction model to predict the user input prefix. This problem prediction method has the disadvantage of poor pertinence and cannot accurately obtain the question that the user wants to consult. Summary of the invention

[0005] This paper aims to solve the problem of low accuracy of text prediction models in the existing technology when predicting user consultation questions.

[0006] In order to solve the above technical problems, the first aspect of this article provides a method for recommending user consultation questions, comprising:

[0007] Determine an input sequence according to continuous prompt encoding information and a prefix text input by a user, wherein the continuous prompt encoding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions and a first text prediction model;

[0008] According to the input sequence and the first text prediction model, a candidate question set is predicted;

[0009] Output the knowledge points corresponding to the candidate question set to the user.

[0010] As a further embodiment of this invention, according to the input sequence and the first text prediction model, after predicting the candidate question set, the following step is further included:

[0011] Scoring the candidate questions in the candidate question set by using a text scoring model to obtain a score for each candidate question in the candidate question set, wherein the text scoring model is obtained by training a second text prediction model by using historical user consultation questions in reverse order;

[0012] Outputting the knowledge points corresponding to the candidate question set to the user further includes: outputting the knowledge points corresponding to the candidate questions ranked top Y in the candidate question set to the user, where Y is a positive integer.

[0013] As a further embodiment of this invention, the process of determining the text scoring model includes:

[0014] Step 101, splicing the continuous prompt coded information and the historical user consultation questions, and performing reverse processing on the spliced ​​text to obtain the reverse text;

[0015] Step 102, determining a conditional probability value of each character in the reverse text according to the reverse text and the second text prediction model;

[0016] Step 103, constructing a first loss function according to the product value of the conditional probability value of each character in the reverse text;

[0017] Step 104, determining whether the first loss function satisfies a first preset condition. If the first loss function does not satisfy the first preset condition, adjusting the parameters in the second text prediction model, and repeating steps 102 to 104 until the first loss function satisfies the first preset condition.

[0018] Step 105: Use the second text prediction model that meets the first preset condition as a text scoring model.

[0019] As a further embodiment of this invention, the candidate questions in the candidate question set are scored using a text scoring model to obtain scores of each candidate question in the candidate question set, including:

[0020] For each candidate question in the candidate question set, perform the following operations:

[0021] splicing the continuous prompt coded information and the candidate question, and reversing the spliced ​​text to obtain a reversed text;

[0022] According to the reverse text and the text scoring model, the conditional probability value of each character in the reverse text is determined;

[0023] The product of the conditional probability values ​​of each character in the reverse text is used as the score of the candidate question.

[0024] As a further embodiment of the present invention, the process of determining the parameters of the hint encoder includes:

[0025] Step 201, constructing a training corpus based on the continuous prompt encoding information output by the prompt encoder with undetermined parameters and historical user consultation questions;

[0026] Step 202, determining the conditional probability value of each character in the training corpus according to the training corpus and the first text prediction model;

[0027] Step 203, constructing a second loss function according to the product of the conditional probability values ​​of each character in the training corpus;

[0028] Step 204, determining whether the second loss function satisfies the second preset condition. If the second loss function does not satisfy the second preset condition, adjusting the parameters of the prompt encoder, and repeating steps 202 to 204 until the second loss function satisfies the second preset condition;

[0029] Step 205: The parameters of the prompt encoder when the second preset condition is met are used as the parameters obtained by prompting the encoder training.

[0030] As a further embodiment of this invention, according to the input sequence and the first text prediction model, a candidate question set is predicted, including:

[0031] Step 301, inputting an input sequence into a first text prediction model, and predicting the probability of each character in a preset dictionary being updated to the input sequence, wherein the preset dictionary at least includes characters in historical user consultation questions;

[0032] Step 302, selecting characters with top X probabilities from the predicted probabilities, where X is a positive integer;

[0033] Step 303, for each filtered character, add the character to the end of the input sequence to obtain an updated input sequence; determine whether the character is a terminator, if the determination result is no, execute step 304, if the determination result is yes, execute step 305;

[0034] Step 304, input the updated input sequence into the first text prediction model, predict the probability of each character in the preset dictionary being updated to the input sequence, and return to execute steps 302 to 303;

[0035] Step 305: Determine a candidate question according to the updated input sequence corresponding to the character.

[0036] As a further embodiment of this invention, it also includes: obtaining user service related information;

[0037] Determining the input sequence according to the continuous prompt coding information and the prefix text input by the user further includes: determining the input sequence according to the continuous prompt coding information, user service related information and the prefix text input by the user.

[0038] The second aspect of this invention provides a user consultation question recommendation system, comprising:

[0039] A processing module, configured to determine an input sequence according to continuous prompt encoding information and a prefix text input by a user, wherein the continuous prompt encoding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions and a first text prediction model;

[0040] A prediction module, used for predicting a candidate question set according to an input sequence and a first text prediction model;

[0041] The output module is used to output the knowledge points corresponding to the candidate question set to the user.

[0042] A third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the computer program executes instructions of the method according to any of the foregoing embodiments.

[0043] A fourth aspect of the present invention provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions of the method according to any of the foregoing embodiments.

[0044] The user consultation question recommendation method, system, computer device and storage medium provided in this article can automatically, reasonably and comprehensively generate continuous prompt encoding information suitable for personalized scenarios by training the prompt encoder using historical user consultation questions and the first text prediction model. The input of the prompt encoder is pseudo prompt information, and the output of the prompt encoder is continuous prompt encoding information. The input sequence is determined according to the continuous prompt encoding information and the prefix text input by the user; the candidate question set is predicted according to the input sequence and the first text prediction model; the knowledge points corresponding to the candidate question set are output to the user, which can standardize the personalized user consultation question prediction task, recommend the knowledge points that the user is most likely to consult in real time, answer the user consultation questions efficiently and intelligently, and improve the accuracy of the user consultation intention reply. At the same time, if the user consultation intention reply is accurate, this article can also increase user stickiness and increase the frequency of interaction.

[0045] In order to make the above and other purposes, features and advantages of this article more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of this article or 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 of this article. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A first flow chart of the method for recommending user consultation questions in the embodiment of this document is shown;

[0048] Figure 2 A second flow chart of the method for recommending user consultation questions according to an embodiment of this invention is shown;

[0049] Figure 3 A flowchart of a process for determining a text scoring model according to an embodiment of this invention is shown;

[0050] Figure 4 A flowchart showing the candidate question scoring process of the embodiment of this article is shown;

[0051] Figure 5 A flowchart of a process for determining prompt encoder parameters according to an embodiment of the present invention is shown;

[0052] Figure 6 A flowchart showing a process of calculating a candidate question set according to an embodiment of this invention is shown;

[0053] Figure 7 A third flow chart of the method for recommending user consultation questions according to the embodiment of this invention is shown;

[0054] Figure 8 The structure diagram of the user consultation question recommendation system in the embodiment of this article is shown;

[0055] Fig. 9 A structural diagram of a computer device according to an embodiment of this invention is shown.

[0056] Description of the accompanying symbols:

[0057] 801, processing module;

[0058] 802, prediction module;

[0059] 803, output module;

[0060] 804, scoring module;

[0061] 902. Computer equipment;

[0062] 904, processor;

[0063] 906. Memory;

[0064] 908, driving mechanism;

[0065] 910, input / output module;

[0066] 912. Input device;

[0067] 914. Output device;

[0068] 916. Presentation equipment;

[0069] 918. Graphical user interface;

[0070] 920, network interface;

[0071] 922, communication link;

[0072] 924. Communication bus. DETAILED DESCRIPTION

[0073] The following will be combined with the drawings in the embodiments of this article to clearly and completely describe the technical solutions in the embodiments of this article. Obviously, the described embodiments are only part of the embodiments of this article, not all of the embodiments. Based on the embodiments of this article, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this article.

[0074] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0075] This specification provides method operation steps as described in the embodiments or flow charts, but more or fewer operation steps may be included based on routine or non-creative work. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel.

[0076] It should be noted that the user consultation question recommendation method and system in this article can be used for problem consultation in the insurance field, and can also be used for problem consultation in any field other than the insurance field, such as problem consultation in the fields of banks, securities companies, e-commerce, etc. The application field of the user consultation question recommendation method and system in this article is not limited.

[0077] The user-related information (including but not limited to business information, user portrait information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this article are all information and data authorized by the user or fully authorized by all parties.

[0078] In one embodiment of the present case, a method for recommending user consultation questions is provided, such as Figure 1 As shown, the user consultation question recommendation method includes:

[0079] Step 100, determining an input sequence according to continuous prompt coding information and a prefix text input by a user, wherein the continuous prompt coding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions and a first text prediction model;

[0080] Step 200, predicting a candidate question set based on the input sequence and the first text prediction model;

[0081] Step 300: output the knowledge points corresponding to the candidate question set to the user to guide the user to select possible knowledge points.

[0082] In detail, the user described in this article can be a customer or an operation / management personnel. The prefix text entered by the user is part of the question entered by the user in real time in the interactive text box. The prefix text entered by the user varies depending on the application scenario, and this article does not limit this. The prompt encoder is used to extract personalized continuous prompt encoding information that conforms to the common characteristics of historical consultation questions based on historical user consultation questions. Pseudo-prompt information can be a randomly set empty parameter, and this article does not limit the specific reasons for the pseudo-prompt information.

[0083] The first text prediction model can select an existing text prediction model in the prior art, such as the GPT-2 model. This article does not limit the specific structure of the text prediction model.

[0084] The candidate question set includes multiple candidate questions, each of which corresponds to one or more knowledge points (i.e., standard answers). In specific implementation, the knowledge points corresponding to the candidate questions can be determined by matching the candidate questions with the knowledge point keywords. Step 300 directly outputs the knowledge points corresponding to the questions into the prompt box based on the prediction of the user's candidate questions, which can facilitate the user to quickly locate the answer to the question they want to consult.

[0085] The user consultation question recommendation method in this article can be written as an intelligent customer service program, client, APP, and applied to servers, cloud devices, medical devices, elderly care auxiliary devices, rehabilitation auxiliary devices, desktop computers, tablet computers, laptops, smart phones, digital assistants, smart wearable devices, etc., or combined devices or systems formed by the interaction of the above carriers, and services based on the above devices or systems. Among them, smart wearable devices can include smart bracelets, smart watches, smart glasses, smart helmets, etc., and can also be separate applications, small programs embedded in other programs, etc., or in the form of web pages, etc., and this article does not limit the specific implementation method.

[0086] This paper uses historical user consultation questions and the first text prediction model to train a prompt encoder, which can automatically, reasonably and comprehensively generate continuous prompt encoding information suitable for personalized scenarios. Through the above step 100, the user consultation question prediction task can be standardized. Through steps 200 and 300, the user's consultation intention can be judged in real time and the knowledge points that the user is most likely to consult can be recommended, guiding the user's consultation content, ensuring the efficiency, intelligence and accuracy of the intelligent customer service answer.

[0087] In order to more accurately determine the recommendation problem of the user's true intention, in one embodiment of this article, Figure 2 As shown, the user consultation question recommendation method includes:

[0088] Step 100, determining an input sequence according to continuous prompt encoding information and a prefix text input by a user, wherein the continuous prompt encoding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained using historical user consultation questions and a first text prediction model;

[0089] Step 200, predicting a candidate question set based on the input sequence and the first text prediction model;

[0090] Step 310, using a text scoring model to score the candidate questions in the candidate question set to obtain a score for each candidate question in the candidate question set, wherein the text scoring model is obtained by training a second text prediction model using historical user consultation questions in reverse order;

[0091] Step 320: output the knowledge points corresponding to the top Y candidate questions in the candidate question set to the user, where Y is a positive integer.

[0092] In detail, the implementation process of step 100 and step 200 can refer to the above-mentioned embodiment, which will not be described in detail here. The second text prediction model and the first text prediction model in step 310 can be the same or different. The number Y of candidate questions screened out in step 320 is less than the number of candidate questions in the candidate question set.

[0093] This paper uses the first text prediction model to predict candidate questions that are dependent on the user-input prefix text and continuous prompt coding information. The text scoring model can determine the dependence of the user-input prefix text and continuous prompt coding information on the candidate questions. By using the first text prediction model in conjunction with the text scoring model, mutually dependent candidate questions can be obtained, thereby improving the accuracy of the candidate questions.

[0094] In one embodiment of this invention, Figure 3 As shown, the process of determining a text scoring model includes:

[0095] Step 101, splicing the continuous prompt coded information and the historical user consultation questions, and performing reverse processing on the spliced ​​text to obtain the reverse text;

[0096] Step 102, determining the probability value of each character condition in the reverse text according to the reverse text and the second text prediction model;

[0097] Step 103, constructing a first loss function according to the product value of the probability value of the condition of each character in the reverse text;

[0098] Step 104, determining whether the first loss function satisfies a first preset condition. If the first loss function does not satisfy the first preset condition, adjusting the parameters in the second text prediction model, and repeating steps 102 to 104 until the first loss function satisfies the first preset condition; if the first loss function satisfies the first preset condition, executing step 105;

[0099] Step 105: Use the second text prediction model that meets the first preset condition as a text scoring model.

[0100] In step 101, it is assumed that the concatenated text obtained by concatenating the continuous prompt coded information and the historical user consultation questions is: h1, ..., h m , e(t o ), ..., e(t n ), the reverse text is: e(t n ), ..., e(t o ), h m , ..., h1.

[0101] When step 102 is implemented, the characters in each reverse text are input into the second text prediction model one by one, and the second text prediction model outputs the conditional probability value of each character in the reverse text. n ), ..., e(t o ), h m , ..., h1, first e(t n ) is input into the second text prediction model to obtain e(t n ) probability, and then e(t n )、e(t n-1 ) is input into the second text prediction model to obtain e(t n-1 ) in e(t n ) condition, and then e(t n )、e(t n-1 )、e(t n-2 ) is input into the second text prediction model to obtain e(t n-2 ) in e(t n-1 ) and e(t n) condition, until the last character is input into the second text prediction model, and the probability of h1 under e(t n ),…,e(t o ), h m ,…, the probability under h2. In summary, the reverse text e(t n ),…,e(t o ), h m ,…,h1The first half of the text sequence is regarded as S=x1,…,x m , the text predicted by the user's inquiry question is regarded as T = x m+1 , …, x m+n , then the probability of user consultation questions generated according to conditional probability is

[0102] In step 103, the process of constructing the first loss function may refer to the prior art, and this document does not make any specific limitation on this.

[0103] When step 104 is implemented, the parameter values ​​in the second text prediction model can be adjusted according to a preset step size, and the preset conditions can be set according to actual needs, such as the first loss function value being the minimum.

[0104] In one embodiment of this invention, Figure 4 As shown, the above step 310 uses the text scoring model to score the candidate questions in the candidate question set to obtain the score of each candidate question in the candidate question set, including:

[0105] For each candidate question in the candidate question set, perform the following operations:

[0106] Step 311, concatenating the continuous prompt coded information and the candidate question, and performing reverse processing on the concatenated text to obtain a reverse text;

[0107] Step 312, determining the conditional probability value of each character in the reverse text according to the reverse text and the text scoring model;

[0108] Step 313: The product of the conditional probability values ​​of the characters in the reverse text is used as the score for the candidate question.

[0109] When step 312 is implemented, the characters in the reverse text are input into the text scoring model one by one to obtain the conditional probability value of each character under the condition of the input characters.

[0110] The product value obtained in step 313 represents the probability of the candidate question being predicted. If a question is predicted based on the user input prefix information, and the text predicted from the question can also infer the user input prefix information with a high probability, it means that the predicted question is the question that the user actually intended.

[0111] In one embodiment of the present invention, when the above step 100 is implemented, it is necessary to first encode the prefix text input by the user, and then concatenate the continuous prompt encoding information and the information after the user input prefix text is encoded to obtain an input sequence.

[0112] In one embodiment of the present invention, the prompt encoder is composed of a bidirectional long short-term memory network (Bi-directional Long Short Term, Bi-LSTM) neural network and a multi-layer perceptron (Multi-layer Perceptron, MLP), wherein the bidirectional long short-term memory network Bi-LSTM neural network includes two long short-term memory network LSTM units of the forward text word vector sequence and the reverse text word vector sequence. Pseudo prompt information t1, ..., t m (m is the number of pseudo-prompt information) is input to the prompt encoder, and the bidirectional long short-term memory network Bi-LSTM neural network outputs the vector sequence h t =[h fw ,h bw ], where h fw represents the output of the LSTM network processing the positive sequence of text word vectors, h bw represents the output of the LSTM network processing the reverse text word vector sequence, h t Represents the vector sequence output of Bi-LSTM; the vector sequence output of Bi-LSTM is input into the multi-layer perceptron MLP to obtain the continuous prompt encoding information h i =MLP([h fw ,h bw ]).

[0113] The prompt encoder provided in this embodiment can not only reduce the training of model parameters, but also solve the problem of discontinuous prompt information. In specific implementation, prompt encoders with other network structures can also be selected. The specific structure of the prompt encoder is not limited in this article. In one embodiment of this article, Figure 5 As shown, the process of determining the prompt encoder parameters includes:

[0114] Step 201, constructing a training corpus based on the continuous prompt encoding information output by the prompt encoder with undetermined parameters and historical user consultation questions;

[0115] Step 202, determining the conditional probability value of each character in the training corpus according to the training corpus and the first text prediction model;

[0116] Step 203, constructing a second loss function according to the product of the conditional probability values ​​of each character in the training corpus;

[0117] Step 204, determining whether the second loss function satisfies the second preset condition. If the second loss function does not satisfy the second preset condition, adjusting the parameters of the prompt encoder, and repeating steps 202 to 204 until the second loss function satisfies the second preset condition;

[0118] Step 205: The parameters of the prompt encoder when the second preset condition is met are used as the parameters obtained by prompting the encoder training.

[0119] In detail, the continuous prompt encoding information outputted by step 201 is not the best information. When step 202 is implemented, one character is added to the first text prediction model each time according to the order of the training corpus from front to back, and the first text prediction model outputs the conditional probability value of each character in the training corpus. For example, if the training corpus is {A, B, C, D}, then {A} is inputted into the first text prediction model for the first time to obtain the probability of A; {A, B} is inputted into the first text prediction model for the second time to obtain the probability of B|A (the probability of B under the condition of A); {A, B, C} is inputted into the first text prediction model for the third time to obtain the probability of C|A, B (the probability of C under the conditions of A and B); {A, B, C, D} is inputted into the first text prediction model for the fourth time to obtain the probability of {D|A, B, C} (the probability of D under the conditions of A, B, C).

[0120] When step 203 is implemented, the second loss function can be constructed with reference to the prior art. This article does not limit the specific formula of the constructed second loss function. The second preset condition can be set according to actual conditions, for example, the second loss function value is the smallest. This article does not limit this.

[0121] This embodiment can, on the basis of not changing the structure of the first text prediction model, use the first text prediction model to predict a prompt encoder, and determine continuous prompt encoding information related to historical user questions through the prompt encoder. The use of the continuous prompt encoding information can assist the first text prediction model to accurately complete the task of generating user consultation questions.

[0122] In one embodiment of this invention, the first text prediction model is composed of an embedding layer, a decoding layer and an output layer.

[0123] The input of the embedding layer is the prefix text input by the user. The prefix text input by the user is encoded by calculating the token embedding and position embedding of each token in the prefix text input by the user to obtain the embedding layer encoding information of the prefix text input by the user. For example, the prefix text input by the customer X = t1, ..., t N After the embedding layer of the first text pre-training model, the embedded coding information e(t0),…,e(tn ).

[0124] The decoder is the main structure of the first text prediction model, which has a powerful feature extraction capability to learn the deep unidirectional encoding representation of words. The input of the decoder is a sequence consisting of continuous prompt encoding information and embedded encoding information of the user input prefix text, such as continuous prompt encoding information h1, ..., h m , the embedded coding information is e(t0),…,e(t n ), then the sequence input to the decoding layer is h1,…,h m , e(t o ),…,e(t n )(m+n represents the length of the text sequence).

[0125] The output layer is connected to the decoding layer, and the number of outputs of the decoding layer and the embedding layer is equal to the number of characters in the preset dictionary. The output layer is used to output the probability of each character in the preset dictionary under the input sequence condition, wherein the preset dictionary at least includes the characters (including punctuation marks) of historical user consultation questions. Of course, in addition to the characters of historical user consultation questions, it can also include technical terms of application scenarios. Taking the insurance field as an example, it also includes the names of various insurances, insurance-related regulations, etc.

[0126] In one embodiment of this invention, Figure 6 As shown, the above step 200 predicts a candidate question set based on the input sequence and the first text prediction model, including:

[0127] Step 301, inputting an input sequence into a first text prediction model, and predicting the probability of each character in a preset dictionary being updated to the input sequence, that is, the probability of each character in the preset dictionary being the next character of the input sequence;

[0128] Step 302, selecting characters with top X probabilities from the predicted probabilities, where X is a positive integer;

[0129] Step 303, for each filtered character, add it to the end of the input sequence to obtain an updated input sequence; determine whether the character is a terminator, if the determination result is no, execute step 304, if the determination result is yes, execute step 305, wherein the terminator is a punctuation mark indicating the end of a sentence, such as a comma, a period, a semicolon, a colon, a semicolon, etc.;

[0130] Step 304, input the updated input sequence into the first text prediction model, predict the probability of each character in the preset dictionary being updated to the input sequence, and return to execute steps 302 to 304;

[0131] Step 305: Determine a candidate question based on the updated input sequence corresponding to the character. Gather all candidate questions to obtain a candidate question set.

[0132] When step 301 is implemented, inputting the input sequence into the first text prediction model actually means inputting the input sequence into the decoding layer of the first text prediction model.

[0133] The output characters in step 302 refer to the encoding values ​​of the characters. The number X of output characters can be set by the designer during algorithm design. Preferably, the value range of X is 3 to 6.

[0134] Step 303 obtains X updated input sequences according to the characters outputted in step 302.

[0135] After step 304 returns to step 302, each updated input sequence will get X characters, so X×X updated input sequences will be obtained. In order to improve the calculation efficiency, the first X input sequences with the largest input sequence probability will be selected from the updated input sequence to repeat the above step 302 and subsequent steps. The probability of an input sequence is the product of the probabilities of the characters added thereafter. For example, if the character A is predicted for the first time, the conditional probability is A1. Based on the character A, the character B is predicted, and the conditional probability is B1. Then the probability of the input sequence including the characters A and B is A1×B1.

[0136] In one embodiment of this invention, in order to make the prompt encoder adapt to various business scenarios, such as Figure 7 As shown, the user consultation question recommendation method includes:

[0137] Step 701, receiving the prefix text input by the user, and obtaining user business related information, wherein the user business related information includes channel information and user portrait (feature information). Taking insurance business consultation as an example, channel information includes official website, Webao, Qingsongchou, Shuidichou and other Internet insurance channels, and user portrait includes customer's insurance purchase history, whether claims have been made, etc.

[0138] Step 702, determining an input sequence according to continuous prompt coding information, user service related information and a prefix text input by the user, wherein the continuous prompt coding information is obtained by encoding pseudo prompt information and personalized information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions, user service related information and a first text prediction model;

[0139] Step 703, predicting a candidate question set based on the input sequence and the first text prediction model;

[0140] Step 704: output the knowledge points corresponding to the candidate question set to the user.

[0141] This embodiment uses historical user consultation questions, user service-related information and the first text prediction model to train the prompt encoder, which can learn the context rules of user consultation questions and then make personalized recommendations for each service.

[0142] Based on the same inventive concept, this article also provides a user consultation question recommendation system, as described in the following embodiments. Since the principle of solving problems by the user consultation question recommendation system is similar to that of the user consultation question recommendation method, the implementation of the user consultation question recommendation system can refer to the user consultation question recommendation method, and the repeated parts will not be repeated.

[0143] Specifically, Figure 8 As shown, the user consultation question recommendation system includes:

[0144] Processing module 801, used to determine an input sequence according to continuous prompt coding information and a prefix text input by a user, wherein the continuous prompt coding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions and a first text prediction model;

[0145] A prediction module 802, configured to predict a candidate question set based on the input sequence and the first text prediction model;

[0146] The output module 803 is used to output the knowledge points corresponding to the candidate question set to the user.

[0147] In order to further improve the accuracy of user consultation question recommendation, the user consultation question recommendation system also includes:

[0148] The scoring module 804 is used to score the candidate questions in the candidate question set using a text scoring model to obtain a score for each candidate question in the candidate question set, wherein the text scoring model is obtained by training a second text prediction model using historical user consultation questions in reverse order.

[0149] The output module 803 outputs the knowledge points corresponding to the top n candidate questions in the candidate question set to the user.

[0150] The modeling process of the prompt encoder and the text scoring model can refer to the aforementioned embodiment, which will not be described in detail here. The specific implementation process of each step can also refer to the aforementioned embodiment, which will not be described in detail here.

[0151] In order to more clearly illustrate the technical solution of this article, the following detailed explanation is given by taking the first text prediction model and the second text prediction model as the GPT-2 model as an example. The implementation process of the user consultation question recommendation method is divided into two stages: the preparation stage and the application stage.

[0152] 1. Preparation

[0153] (1) Construct pseudo prompt text t1,…,t m , using a bidirectional long short-term memory network Bi-LSTM neural network and a multi-layer perceptron MLP as the prompt encoder. Pseudo prompt text t1,…,t m Input to the prompt encoder can generate continuous prompt encoding information h1, ..., h m .

[0154] (2) Using the continuous prompt encoding information and the prefix information input by the user, the prompt encoder is trained through the GPT-2 model:

[0155] The prefix information input by the user is input into the embedding layer of the GPT-2 model to obtain the embedded coding information e(t0),…,e(t n );

[0156] The continuous prompt coding information, business related information and embedded coding information are used as training corpus h1,…,h m , e(t o ),…,e(t n )(m+n represents the length of the text sequence), determine the loss function according to the training corpus and the GPT-2 model, and use the loss function to train the prompt encoder, that is, use the loss function to optimize the continuous prompt encoding information. When the loss function meets the preset conditions, the best prompt encoder is obtained, and the pseudo prompt text is input into the trained prompt encoder to obtain the best continuous prompt encoding information.

[0157] (3) reversing the best continuous prompt coding information, service-related information, and embedded coding information of the prefix text input by the user obtained in step (2) to obtain a reverse text;

[0158] Use reverse text to train the GPT-2 model to obtain a text prediction model: During the training process, the parameters of GPT-2 are continuously input into the GPT-2 model as the reverse text is continuously input, and the model training is finally completed through continuous learning.

[0159] 2. Application Phase

[0160] (1) Deploy the trained prompt encoder, GPT-2 model, and text scoring model.

[0161] (2) When a user asks a question through the intelligent customer service, the system automatically obtains the prefix information, business-related information and continuous prompt encoding information input by the user, concatenates the continuous prompt encoding information generated by the prompt encoder, the business-related information and the prefix information input by the user, calls the GPT-2 model based on the concatenated information, and predicts the top-n candidate question set.

[0162] (3) The continuous prompt encoding information, business-related information and predictions are concatenated to obtain the encoded information of each candidate question in the top-n candidate question set. The text scoring model is used to calculate the score of each candidate question, thereby screening out the top-m candidate questions.

[0163] (4) Based on the top-m candidate questions, the corresponding question knowledge points are retrieved from the knowledge points in the knowledge base through elastic retrieval and output to the user.

[0164] When users see the question knowledge points recommended by the system, it will affect their subconsciousness and guide them to click on the relevant knowledge points. When users click on the knowledge points, the system will return the answers to the knowledge points in real time and accurately. In this way, not only can the question-and-answer system provide 100% accuracy in question-and-answer, but users can also get satisfactory consulting services through intelligent services.

[0165] In one embodiment of the present invention, a computer device is also provided, such as Fig. 9 As shown, the computer device 902 may include one or more processors 904, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. The computer device 902 may also include any memory 906, which is used to store the program code of the user consultation problem recommendation method described in any of the aforementioned embodiments. Non-restrictive, for example, the memory 906 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 902. In one case, when the processor 904 executes an associated instruction stored in any memory or a combination of memories, the computer device 902 may perform any operation of the associated instruction. The computer device 902 also includes one or more drive mechanisms 908 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0166] The computer device 902 may also include an input / output module 910 (I / O) for receiving various inputs (via input devices 912) and for providing various outputs (via output devices 914). A specific output mechanism may include a presentation device 916 and an associated graphical user interface 918 (GUI). In other embodiments, the input / output module 910 (I / O), the input device 912, and the output device 914 may not be included, and the computer device 902 may be used as a computer device in a network. The computer device 902 may also include one or more network interfaces 920 for exchanging data with other devices via one or more communication links 922. One or more communication buses 924 couple the components described above together.

[0167] The communication link 922 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 922 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0168] Corresponds to Figure 1-Figure 7 The method in this article also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.

[0169] The embodiment of the present invention also provides a computer readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 7 The method shown.

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

[0171] It should also be understood that in the embodiments of this article, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0172] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.

[0173] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0174] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.

[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.

[0176] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.

[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0178] Specific embodiments are used in this article to illustrate the principles and implementation methods of this article. The description of the above embodiments is only used to help understand the methods and core ideas of this article. At the same time, for general technicians in this field, according to the ideas of this article, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on this article.

Claims

1. A method for recommending user consultation questions, characterized in that: include: Determine an input sequence according to continuous prompt encoding information and a prefix text input by a user, wherein the continuous prompt encoding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions and a first text prediction model; Predicting a candidate question set according to the input sequence and the first text prediction model; Outputting the knowledge points corresponding to the candidate question set to the user; The process of determining the parameters of the hint encoder includes: Step 201, constructing a training corpus based on the continuous prompt encoding information output by the prompt encoder with undetermined parameters and historical user consultation questions; Step 202, determining a conditional probability value of each character in the training corpus according to the training corpus and the first text prediction model; Step 203, constructing a second loss function according to the product of the conditional probability values ​​of each character in the training corpus; Step 204, determining whether the second loss function satisfies a second preset condition. If the second loss function does not satisfy the second preset condition, adjusting the parameters of the prompt encoder, and repeating steps 202 to 204 until the second loss function satisfies the second preset condition. Step 205: Using the parameters of the prompt encoder when the second preset condition is met as the parameters obtained by training the prompt encoder.

2. The method according to claim 1, characterized in that After predicting the candidate question set according to the input sequence and the first text prediction model, the method further includes: Scoring the candidate questions in the candidate question set by using a text scoring model to obtain a score for each candidate question in the candidate question set, wherein the text scoring model is obtained by training a second text prediction model by using historical user consultation questions in reverse order; Outputting the knowledge points corresponding to the candidate question set to the user further includes: outputting the knowledge points corresponding to the candidate questions ranked top Y in the candidate question set to the user, where Y is a positive integer.

3. The method according to claim 2, characterized in that The process of determining the text scoring model includes: Step 101, splicing the continuous prompt coded information and the historical user consultation questions, and performing reverse processing on the spliced ​​text to obtain a reverse text; Step 102, determining a conditional probability value of each character in the reverse text according to the reverse text and the second text prediction model; Step 103, constructing a first loss function according to the product value of the conditional probability value of each character in the reverse text; Step 104, determining whether the first loss function satisfies a first preset condition. If the first loss function does not satisfy the first preset condition, adjusting the parameters in the second text prediction model, and repeating steps 102 to 104 until the first loss function satisfies the first preset condition. Step 105: Use the second text prediction model that meets the first preset condition as a text scoring model.

4. The method according to claim 2, characterized in that Scoring the candidate questions in the candidate question set using the text scoring model to obtain the score of each candidate question in the candidate question set includes: For each candidate question in the candidate question set, perform the following operations: splicing the continuous prompt coded information and the candidate question, and reversing the spliced ​​text to obtain a reversed text; Determining a conditional probability value of each character in the reverse text according to the reverse text and the text scoring model; The product value of the conditional probability values ​​of each character in the reverse text is used as the score of the candidate question.

5. The method according to claim 1, characterized in that According to the input sequence and the first text prediction model, a candidate question set is predicted, including: Step 301, inputting the input sequence into the first text prediction model, and predicting the probability of each character in a preset dictionary being updated to the input sequence, wherein the preset dictionary at least includes characters in historical user consultation questions; Step 302, selecting characters with top X probabilities from the predicted probabilities, where X is a positive integer; Step 303, for each filtered character, add the character to the end of the input sequence to obtain an updated input sequence; determine whether the character is a terminator, if the determination result is no, execute step 304, if the determination result is yes, execute step 305; Step 304, inputting the updated input sequence into the first text prediction model, predicting the probability of each character in the preset dictionary being updated to the input sequence, and returning to execute steps 302 to 303; Step 305: Determine a candidate question according to the updated input sequence corresponding to the character.

6. The method according to claim 1, characterized in that Also includes: Obtain user business-related information; The prompt encoder is trained using historical user consultation questions, user service related information and a first text prediction model; Determining the input sequence according to the continuous prompt coding information and the prefix text input by the user further includes: determining the input sequence according to the continuous prompt coding information, user service related information and the prefix text input by the user.

7. A user consultation question recommendation system, characterized in that: include: A processing module, configured to determine an input sequence according to continuous prompt encoding information and a prefix text input by a user, wherein the continuous prompt encoding information is obtained by encoding pseudo prompt information by a prompt encoder, and the prompt encoder is trained by using historical user consultation questions and a first text prediction model; A prediction module, configured to predict a candidate question set based on the input sequence and the first text prediction model; An output module, used to output the knowledge points corresponding to the candidate question set to the user; The process of determining the parameters of the hint encoder includes: Step 201, constructing a training corpus based on the continuous prompt encoding information output by the prompt encoder with undetermined parameters and historical user consultation questions; Step 202, determining a conditional probability value of each character in the training corpus according to the training corpus and the first text prediction model; Step 203, constructing a second loss function according to the product of the conditional probability values ​​of each character in the training corpus; Step 204, determining whether the second loss function satisfies a second preset condition. If the second loss function does not satisfy the second preset condition, adjusting the parameters of the prompt encoder, and repeating steps 202 to 204 until the second loss function satisfies the second preset condition. Step 205: Using the parameters of the prompt encoder when the second preset condition is met as the parameters obtained by training the prompt encoder.

8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 6.

9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes instructions of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Information processing method and device and terminal

    CN109033156A