Intelligent dialog method and apparatus

By preprocessing and similarity calculation, combined with question-answering knowledge base and model optimization, the intelligent dialogue system improves the accuracy of question answering results and solves the problem of low answer accuracy in existing technologies.

CN116204621BActive Publication Date: 2026-02-17IND BANK CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310107450.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2026-02-17
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

Existing intelligent dialogue systems cannot guarantee the accuracy of question responses.

Method used

By acquiring the user's target problem, preprocessing the target problem, obtaining multiple reference questions and their corresponding reference answers, and determining the target answer based on similarity, the similarity calculation is optimized using a representational semantic matching model and a fine-tuned language representation model, and the model is updated by combining the question-answering knowledge base and feedback results.

Benefits of technology

It improved the accuracy of question and answer results, enhanced the semantic matching ability of the intelligent dialogue system, and ensured the accuracy of the answer results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204621B_ABST
    Figure CN116204621B_ABST
Patent Text Reader

Abstract

The application relates to an intelligent dialogue method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining a target problem to be solved by a user; preprocessing the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and reference reply results corresponding to the reference problems; and determining a target reply result of the target problem to be solved from the reference reply results according to the similarity between the target problem to be solved and the reference problems. The method can improve the problem reply accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to an intelligent conversation method and device, a computer device, a storage medium, and a computer program product. BACKGROUND

[0002] With the development of artificial intelligence technology, an intelligent conversation system appears. The intelligent conversation system is a human-computer interaction system, which is used to solve the problem raised by a user when the user raises the problem, so that the situation that the user can only get a reply result through tedious operation can be avoided.

[0003] Generally, when a reply result is replied to a user by analyzing a problem raised by the user in an intelligent conversation system, the accuracy of the problem reply result cannot be guaranteed. SUMMARY

[0004] Therefore, it is necessary to provide an intelligent conversation method, device, computer device, computer readable storage medium, and computer program product capable of improving the accuracy of problem reply.

[0005] In a first aspect, the present application provides an intelligent conversation method, which comprises:

[0006] obtaining a target problem to be solved of a user;

[0007] preprocessing the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and a reference reply result corresponding to each reference problem;

[0008] determining a target reply result of the target problem to be solved from the reference reply results according to the similarity between the target problem to be solved and each reference problem.

[0009] In one embodiment, the preprocessing the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and a reference reply result corresponding to each reference problem comprises:

[0010] obtaining a keyword in the target problem to be solved;

[0011] when it is determined that the keyword is outside the sensitive word library, obtaining a plurality of candidate words with the same word meaning as the keyword;

[0012] obtaining a candidate problem corresponding to each candidate word according to each candidate word and a question and answer knowledge base;

[0013] According to the similarity between the target problem to be solved and each of the candidate problems, each of the reference problems and each of the reference reply results corresponding to each of the reference problems are obtained from each of the candidate problems.

[0014] In one embodiment, the obtaining, according to the similarity between the target problem to be solved and each of the candidate problems, each of the reference problems and each of the reference reply results corresponding to each of the reference problems from each of the candidate problems comprises:

[0015] According to the similarity between the target problem to be solved and each of the candidate problems, a plurality of candidate problems with a similarity within a first preset range to the target problem to be solved are selected from each of the candidate problems, each of the reference problems is obtained, and each of the reference reply corresponding to each of the reference problems is obtained.

[0016] In one embodiment, the similarity between the target problem to be solved and each of the candidate problems is obtained in the following manner:

[0017] Each of the candidate word frequency matrices corresponding to each of the candidate problems and the target word frequency matrix of the target problem to be solved are obtained.

[0018] According to the typological semantic matching model, each of the candidate word frequency matrices and the target word frequency matrix are fused to obtain the similarity between the plurality of candidate problems and the target problem to be solved.

[0019] In one embodiment, the method further comprises:

[0020] The feedback result of the user for the target reply result is obtained.

[0021] If the feedback result indicates that the target problem to be solved has been solved, the target problem to be solved and the corresponding target reply result are stored in a positive sample set; the positive sample set comprises a sample set in which the problem to be solved and the problem in the question and answer knowledge base are semantically identical.

[0022] If the feedback result indicates that the target problem to be solved has not been solved, the target problem to be solved and the corresponding target reply result are stored in a negative sample set; the negative sample set comprises a sample set in which the problem to be solved and the problem in the question and answer knowledge base are semantically different.

[0023] According to the positive sample set and the negative sample set, the loss function of the typological semantic matching model is updated to minimize the loss function.

[0024] In an embodiment, the preprocessing the target problem to be solved comprises:

[0025] According to the fine-tuned language representation model, a target problem vector of the target problem to be solved is obtained;

[0026] According to the similarity between the target problem vector and the problem vectors in the question and answer knowledge base, a plurality of reference problem vectors with a similarity to the target problem vector within a second preset range are selected from the question and answer knowledge base.

[0027] According to each of the reference problem vectors and the question and answer knowledge base, each of the reference problem vectors corresponding to each of the reference problems and each of the reference answer results corresponding to each of the reference problems is obtained.

[0028] In an embodiment, the fine-tuned language representation model is obtained in the following manner:

[0029] A training problem sample is obtained.

[0030] A first embedding expression vector obtained after the training problem sample is input into the language representation model for the first time is obtained.

[0031] A second embedding expression vector obtained after the training problem sample is input into the language representation model for the second time is obtained.

[0032] According to the first embedding expression vector and the second embedding expression vector, the batch size and the loss rate of the language representation model are updated when the objective optimization function is maximized, so as to obtain the fine-tuned language representation model.

[0033] In an embodiment, the target answer result of the target problem to be solved is determined from the reference answer results according to the similarity between the target problem to be solved and each of the reference problems, comprising:

[0034] If the maximum similarity between the plurality of reference problems and the target problem to be solved is greater than or equal to a first threshold value, the reference answer result of the reference problem corresponding to the maximum similarity is determined as the target answer result of the target problem to be solved.

[0035] In an embodiment, the method further comprises:

[0036] If the maximum similarity between the plurality of reference problems and the target problem to be solved is less than the first threshold value, and the minimum similarity between the plurality of reference problems and the target problem to be solved is less than a second threshold value, an artificial customer service is accessed; wherein the second threshold value is less than the first threshold value.

[0037] In a second aspect, the present application provides an intelligent dialogue device. The device comprises:

[0038] a first obtaining module, configured to obtain a target problem to be solved by a user;

[0039] a second obtaining module, configured to preprocess the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and reference reply results corresponding to the reference problems respectively;

[0040] a processing module, configured to determine a target reply result of the target problem to be solved from the reference reply results according to similarities between the target problem to be solved and the reference problems respectively.

[0041] In a third aspect, the present application provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0042] obtaining a target problem to be solved by a user;

[0043] preprocessing the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and reference reply results corresponding to the reference problems respectively;

[0044] determining a target reply result of the target problem to be solved from the reference reply results according to similarities between the target problem to be solved and the reference problems respectively.

[0045] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program implements the following steps when executed by a processor:

[0046] obtaining a target problem to be solved by a user;

[0047] preprocessing the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and reference reply results corresponding to the reference problems respectively;

[0048] determining a target reply result of the target problem to be solved from the reference reply results according to similarities between the target problem to be solved and the reference problems respectively.

[0049] In a fifth aspect, the present application provides a computer program product. The computer program product comprises a computer program, and the computer program implements the following steps when executed by a processor:

[0050] obtaining a target problem to be solved by a user;

[0051] preprocessing the target problem to be solved, obtaining a plurality of reference problems corresponding to the target problem to be solved and each reference reply result corresponding to each reference problem;

[0052] determining the target reply result of the target problem to be solved from each reference reply result according to the similarity between the target problem to be solved and each reference problem.

[0053] The intelligent dialogue method, device, computer device, storage medium and computer program product obtain the target problem to be solved of the user, preprocess the target problem to be solved, obtain a plurality of reference problems corresponding to the target problem to be solved and each reference reply result corresponding to each reference problem, and then determine the target reply result of the target problem to be solved from each reference reply result according to the similarity between the target problem to be solved and each reference problem. The method according to the present application can improve the accuracy of the reply result by analyzing the target problem to be solved in multiple dimensions according to the plurality of reference problems corresponding to the target problem to be solved. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 An application environment diagram of the intelligent dialogue method in one embodiment;

[0055] Figure 2 A flowchart of the intelligent dialogue method in one embodiment;

[0056] Figure 3 A flowchart of preprocessing the target problem to be solved, obtaining a plurality of reference problems corresponding to the target problem to be solved and each reference reply result corresponding to each reference problem in one embodiment;

[0057] Figure 4 A flowchart of the similarity between the target problem to be solved and each candidate problem in one embodiment;

[0058] Figure 5 A flowchart of the intelligent dialogue method in another embodiment;

[0059] Figure 6 A flowchart of preprocessing the target problem to be solved, obtaining a plurality of reference problems corresponding to the target problem to be solved and each reference reply result corresponding to each reference problem in one embodiment;

[0060] Figure 7 A flowchart of the obtaining method of the fine-tuned language representation model in one embodiment;

[0061] Figure 8 A flowchart of the intelligent dialogue method in one embodiment;

[0062] Figure 9 A structural block diagram of an intelligent dialogue device in an embodiment;

[0063] Figure 10 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0064] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.

[0065] The intelligent dialogue method provided by the embodiments of the present application can be applied to an application environment as shown in the figure. Figure 1 The intelligent dialogue system includes a user interaction layer, an interface layer, a service layer, a recall layer and a data layer. The user interaction layer is used to provide interface services of intelligent customer service, the interface layer is used to obtain a problem query request of a user, the service layer and the recall layer are used to perform corresponding processing based on the problem query request of the user.

[0066] Specifically, the construction method of the user interaction layer includes: 1) constructing a Flask-based underlying framework, deploying a data layer and a model layer, the model layer is used to provide a representative semantic matching model and a fine-tuned language representation model, and the data layer is used to provide a synonym library / paronymous library, a sensitive word library and a question and answer knowledge base; 2) using Nginx reverse proxy to realize load balancing and resource separation of static and dynamic pages; 3) using flask_cors to solve the cross-domain problem of the user terminal requesting the intelligent customer interface service of the server; constructing an intelligent customer interface service, adding a sensitive word detector, a wrong word filter and a semantic enhancer. Using a DFA algorithm and a sensitive word library to construct a sensitive word detector to automatically intercept a problem query request containing a sensitive word, using macbert_corrector in pycorrector to combine a synonym library and an artificial corpus to construct a wrong word filter and a semantic enhancer, thereby improving the accuracy of semantic matching and enriching the semantic information of the small sample data set. 4) constructing an intelligent customer service robot front-end chat window, constructing a virtual customer service to conduct real-time communication and dialogue with a user, and completely deploying intelligent dialogue technology based on small sample learning and deep semantic matching.

[0067] In an embodiment, the question query request is preprocessed by a text preprocessing module in the business layer in combination with the synonym library / paraphrase library and the sensitive word library in the data layer, a plurality of candidate questions corresponding to the question in the question query request are determined by a recall module in the recall layer in combination with the question and answer knowledge base in the data layer, the similarity between the plurality of candidate questions and the question in the question query request is ranked by a ranking module to select a plurality of reference questions from the plurality of candidate questions, and then the reply result corresponding to the question in the question query request is determined from the reply results corresponding to the plurality of reference questions, and the reply result corresponding to the question in the question query request is replied to the user by the user interaction layer.

[0068] In an embodiment, the question query request can be preprocessed by a text preprocessing module in the business layer according to the fine-tuned language representation model, a plurality of reference questions corresponding to the question in the question query request and corresponding reply results are obtained in combination with the question and answer knowledge base in the data layer, and then the reply result corresponding to the question in the question query request is determined from the reply results corresponding to the plurality of reference questions, and the reply result corresponding to the question in the question query request is replied to the user by the user interaction layer.

[0069] In an embodiment, as shown in Figure 2 , an intelligent dialogue method is provided, and the intelligent dialogue system in Figure 1 is taken as an example to illustrate the method, which includes the following steps:

[0070] S202, obtaining a target problem to be solved by a user.

[0071] The intelligent dialogue system can be applied to an intelligent dialogue scenario between the user and the intelligent customer service, for example, in a bank financial scenario, the user can input the target problem to be solved through a user terminal, or the user can input the target problem to be solved through voice input, so that the intelligent dialogue system can reply to the user with the question reply result in the form of intelligent customer service based on the question raised by the user.

[0072] S204, preprocessing the target problem to be solved to obtain a plurality of reference questions corresponding to the target problem to be solved and a plurality of reference reply results corresponding to the reference questions.

[0073] In one embodiment, the reference questions corresponding to the target problem to be solved and the reference reply results corresponding to the reference questions can be obtained from the question and answer knowledge base according to the keywords in the target problem to be solved.

[0074] In one embodiment, the target reply result of the target problem to be solved is determined from the reference reply results according to the similarity between the target problem to be solved and the reference questions.

[0075] In some embodiments, the reference reply result corresponding to the reference question with the largest similarity can be selected as the target reply result according to the similarity between the target problem to be solved and the reference questions. In some embodiments, the reference reply result corresponding to the reference question with a similarity greater than a threshold value can be selected as the target reply result according to the similarity between the target problem to be solved and the reference questions. If there are multiple reference questions with a similarity greater than the threshold value, the corresponding multiple reference reply results can be provided for the user to select the target reply result of the target problem to be solved.

[0076] In summary, in the embodiments shown in the above, Figure 2 In the embodiments shown in the above, the target problem to be solved of the user is obtained, the target problem to be solved is preprocessed, the reference questions corresponding to the target problem to be solved and the reference reply results corresponding to the reference questions are obtained, and then the target reply result of the target problem to be solved is determined from the reference reply results according to the similarity between the target problem to be solved and the reference questions. The method of the present application analyzes the target problem to be solved in multiple dimensions according to the multiple reference questions corresponding to the target problem to be solved, so that the accuracy of the reply result can be improved when the target reply result of the target problem to be solved is determined from the reference reply results.

[0077] In one embodiment, the target reply result of the target problem to be solved is determined from the reference reply results according to the similarity between the target problem to be solved and the reference questions, including: if the maximum similarity between the multiple reference questions and the target problem to be solved is greater than or equal to a first threshold value, the reference reply result of the reference question corresponding to the maximum similarity is determined as the target reply result of the target problem to be solved.

[0078] In an embodiment, if the maximum similarity between the plurality of reference questions and the target problem to be solved is less than the first threshold value, and the minimum similarity between the plurality of reference questions and the target problem to be solved is less than the second threshold value, an artificial customer service is accessed; wherein the second threshold value is less than the first threshold value. For example, the first threshold value can be 90% or other values, and the second threshold value can be 20% or other values. The specific values of the first threshold value and the second threshold value can be set according to the actual application scene, and the embodiment is not limited specifically.

[0079] In an embodiment, if the maximum similarity between the plurality of reference questions and the target problem to be solved is less than the first threshold value, and the minimum similarity between the plurality of reference questions and the target problem to be solved is greater than or equal to the second threshold value, the reference reply results corresponding to the plurality of reference questions are displayed for the user to select to obtain the target reply result of the target problem to be solved.

[0080] In an embodiment, as shown in Figure 3 , a flowchart diagram of a process of preprocessing a target problem to be solved to obtain a plurality of reference questions corresponding to the target problem to be solved and reference reply results corresponding to each reference question is provided, including the following steps:

[0081] S302, obtaining a keyword in the target problem to be solved.

[0082] The keyword in the target problem to be solved can be used to understand the core meaning that the user wants to express, and the keyword in the target problem to be solved can include a word composed of one or more words in the target problem to be solved. For example, the keyword in the target problem to be solved can include a place, a time, and a person's name, etc. In some embodiments, the keyword in the target problem to be solved can be extracted by a natural language processing (NLP) technology.

[0083] S304, when it is determined that the keyword is outside the sensitive word library, a plurality of candidate words with the same word meaning as the keyword are obtained.

[0084] In combination Figure 1 , a text preprocessing module for sensitive word detection can be constructed based on the DFA algorithm. After obtaining the keyword in the target problem to be solved, the text preprocessing module can determine whether the keyword in the target problem to be solved is in the sensitive word library according to the tree search structure of the DFA algorithm, so as to effectively detect the sensitive word and realize the preprocessing of the chat dialogue text. If the keyword in the target problem to be solved is outside the sensitive word library, a plurality of candidate words with the same word meaning as the keyword are selected from the synonym library and the near-synonym library according to the keyword in the target problem to be solved. If the keyword in the target problem to be solved is in the sensitive word library, the user is notified to input or input the target problem to be solved again.

[0085] In an embodiment, the sensitive word library can be constructed based on an open source sensitive word library combined with application field related sensitive words. A synonym library / paronym library based on an electronic design automation (EDA) tool can be built, and the EDA tool can be used to customize a synonym interface and a paronym interface for different contexts. In this way, when it is determined that the key word in the target problem to be solved is outside the sensitive word library, the context corresponding to the key word can be determined according to the key word in the target problem to be solved, the context is called to invoke the supplement interface based on the context, and the purpose of selecting multiple candidate words with the same word meaning as the key word from the synonym library\paronym library is achieved.

[0086] S306, according to each candidate word and the question and answer knowledge base, obtaining each candidate question corresponding to each candidate word.

[0087] In some embodiments, a question and answer knowledge base based on the SimCSE algorithm and the ElasticSearch tool can be built. Specifically, the SimCSE algorithm can be used to calculate the feature vector corresponding to each question in the training sample, and each question has a corresponding answer result. The content stored in the question and answer knowledge base includes the feature vector (or question vector) corresponding to the question, the question, and the answer result of the question. It can be understood that through the pre-set question and answer knowledge base, the problem of high retrieval time complexity during question matching can be solved, and the question answering efficiency can be improved.

[0088] In an embodiment, when traversing all questions in the question and answer knowledge base, if each candidate word exists in the question in the question and answer knowledge base, the question containing each candidate word in the question and answer knowledge base and the question answer result corresponding to the question can be selected to obtain each candidate question corresponding to each candidate word.

[0089] S308, according to the similarity between the target problem to be solved and each candidate question, obtaining each reference question and each reference answer result corresponding to each reference question from each candidate question.

[0090] In an embodiment, according to the similarity between the target problem to be solved and each candidate question, each reference question and each reference answer result corresponding to each reference question are obtained from each candidate question, which includes: according to the similarity between the target problem to be solved and each candidate question, selecting multiple candidate questions with a similarity to the target problem to be solved within a first preset range from each candidate question, obtaining each reference question and each reference answer result corresponding to each reference question.

[0091] It can be understood that after obtaining the similarities between the target problem to be solved and each candidate problem, the similarities are sorted, and TopK is used to select each reference question from each candidate question, and then each reference answer corresponding to each reference question is obtained according to the question and answer knowledge base.

[0092] In summary, in the Figure 3 In the embodiment shown, by obtaining the keywords in the target problem to be solved, and when it is determined that the keywords are outside the sensitive word library, a plurality of candidate words with the same word meaning as the keywords are obtained, so that the problem retrieval accuracy can be improved from the perspective of multi-layer semantics, and then each reference question corresponding to each candidate word and each reference answer result corresponding to each reference question are obtained according to the question and answer knowledge base. By using a plurality of candidate words with the same word meaning as the keywords in the target problem to be solved, the intelligent matching range of the user's target problem to be solved can be expanded, so that when the target answer result of the target problem to be solved is determined from each reference answer result corresponding to each candidate word, the accuracy of the answer result can be improved.

[0093] In one embodiment, as Figure 4 shown, a flowchart of an acquisition method of the similarity between the target problem to be solved and each candidate question is provided, including the following steps:

[0094] S402, obtaining each candidate word frequency matrix corresponding to each candidate question and a target word frequency matrix of the target problem to be solved.

[0095] S404, according to the representative semantic matching model, fusing each candidate word frequency matrix and the target word frequency matrix to obtain the similarity between the plurality of candidate questions and the target problem to be solved.

[0096] In one embodiment, each candidate word frequency matrix corresponding to each candidate question and the target word frequency matrix of the target problem to be solved can be obtained according to the jieba toolkit, so as to strengthen the attention effect to the keywords in the question; and the representative semantic matching model based on unsupervised learning can solve the problem of low semantic matching accuracy in the small data set scenario; and then when each candidate word frequency matrix and the target word frequency matrix are fused according to the representative semantic matching model, the similarity between the plurality of candidate questions and the target problem to be solved can be more accurately obtained.

[0097] In the embodiment shown, Figure 4 by obtaining each candidate word frequency matrix corresponding to each candidate question and a target word frequency matrix of the target problem to be solved, the attention effect to the keywords in the question is strengthened, and then each candidate word frequency matrix and the target word frequency matrix are fused according to the representative semantic matching model, so that the similarity between the plurality of candidate questions and the target problem to be solved can be accurately obtained.

[0098] InFigure 4 Based on the illustrated embodiments, in one embodiment, such as Figure 5 As shown, it may also include the following steps:

[0099] S502, Obtain user feedback on the target response.

[0100] S504 If the feedback result indicates that the target problem has been solved, store the target problem and the corresponding target response result into the positive sample set.

[0101] S506 If the feedback result indicates that the target unresolved problem has not been resolved, store the target unresolved problem and the corresponding target response result in the negative sample set.

[0102] S508: Based on the positive and negative sample sets, update the representational semantic matching model with the goal of minimizing the loss function of the representational semantic matching model.

[0103] The positive sample set includes a set of samples whose semantics are the same as the questions in the question-answering knowledge base, while the negative sample set includes a set of samples whose semantics are different from the questions in the question-answering knowledge base. By updating the questions in the positive or negative sample sets, the representational semantic matching model can be optimized, thereby improving the accuracy when solving the similarity between questions based on the updated representational semantic matching model.

[0104] In one embodiment, the loss function is L cos L indicates cos Satisfy the following formula:

[0105]

[0106] Among them, Ω pos Ω represents the set of positive samples. neg Let represent the negative sample set, i and j represent the unresolved issues and corresponding responses in the positive sample set, respectively, and m and n represent the unresolved issues and corresponding responses in the negative sample set, respectively.

[0107] In summary, Figure 5In the illustrated embodiment, by obtaining user feedback on the target response, and then updating the positive or negative sample set based on the feedback, the representational semantic matching model is optimized based on the updated positive or negative sample set. The loss function enables the model to learn that the cosine similarity between positive sample pairs is greater than the cosine similarity between negative samples, thereby improving the model's ability to identify text similarity and increasing the accuracy of the obtained similarity between questions. Furthermore, when selecting reference questions and their corresponding reference responses based on this similarity, the accuracy of the response can be improved when determining the target response for the problem to be solved from the reference responses corresponding to each candidate word.

[0108] In one embodiment, such as Figure 6 As shown, a flowchart illustrates a process for preprocessing a target problem to obtain multiple reference problems corresponding to the target problem and reference responses for each reference problem. The flowchart includes the following steps:

[0109] S602, based on the fine-tuned language representation model, obtain the target problem vector of the problem to be solved.

[0110] S604, based on the similarity between the target question vector and the question vectors in the question-answering knowledge base, select multiple reference question vectors from the question-answering knowledge base whose similarity to the target question vector falls within a second preset range.

[0111] In some embodiments, the method of obtaining the preset feature vector library includes: obtaining sentence vector representations of training question samples using a fine-tuned language representation model, building an index for the feature vectors using ElasticSearch, storing them in the ElasticSearch feature vector library, and further obtaining a question-answering knowledge base.

[0112] In some embodiments, the question-answering knowledge base includes: the feature vector (or question vector) corresponding to the question, the question, and the answer to the question. Therefore, after obtaining the similarity between the target question vector and the question vector in the question-answering knowledge base, the similarity is sorted. The TopK method can be used to select multiple reference question vectors from the question-answering knowledge base whose similarity to the target question vector is within a second preset range.

[0113] S606, based on each reference question vector and the question-answer knowledge base, obtain each reference question corresponding to each reference question vector and each reference answer corresponding to each reference question.

[0114] In some embodiments, the question-answering knowledge base includes: a feature vector (or question vector) corresponding to a question, a question, and the answer to the question. Therefore, after selecting multiple reference question vectors from the question-answering knowledge base, the reference questions corresponding to each reference question vector and the reference answer results corresponding to each reference question can be obtained according to the mapping relationship between the question, the question vector, and the answer results corresponding to the question.

[0115] In summary, Figure 6 In the illustrated embodiment, the problem of needing frequent transfer training of the model can be solved by using a fine-tuned language representation model. Thus, based on the fine-tuned language representation model, a target question vector for the problem to be solved is obtained. Then, based on the similarity between the target question vector and question vectors in the question-answering knowledge base, multiple reference question vectors with a similarity within a second preset range to the target question vector are selected from the question-answering knowledge base. Next, based on each reference question vector and the question-answering knowledge base, each reference question and each reference answer result corresponding to each reference question are obtained. Finally, based on the similarity between the target problem and each reference question, the target answer result for the target problem is determined from the reference answer results. The method of this application analyzes the target problem from multiple dimensions, thus improving the accuracy of the answer result when determining the target answer result from the reference answer results.

[0116] In one embodiment, such as Figure 7 The diagram illustrates a process for obtaining a fine-tuned language representation model, including the following steps:

[0117] S702, Obtain training problem samples.

[0118] In some embodiments, training question samples can be obtained from a database that stores questions raised by users who have previously used the intelligent dialogue platform, as well as open-source question samples related to intelligent dialogue. By obtaining training question samples, the language representation model can be optimized based on the training question samples.

[0119] S704, obtain the first embedding representation vector obtained after the training problem sample is first input into the language representation model.

[0120] S706, Obtain the second embedding representation vector obtained after inputting the training problem sample into the language representation model for the second time.

[0121] In the language representation model, due to the Dropout mask mechanism, different embedding vectors for the same question can be obtained in the encoding layer. Therefore, inputting a training question sample into the language representation model for the first time yields the corresponding first embedding vector, and inputting the training question sample into the language representation model for the second time yields the corresponding second embedding vector.

[0122] S708, based on the first and second embedded representation vectors, while maximizing the objective optimization function, update the batch size and loss rate of the language representation model to obtain the fine-tuned language representation model.

[0123] In some embodiments, the objective optimization function can be used Indicate, then Satisfy the following formula:

[0124]

[0125] Among them, v i This represents the first embedding representation vector. This represents the second embedding representation vector, and N represents the batch size of the language representation model. τ represents the dropout rate, and τ represents the temperature hyperparameter controlling the Softmax distribution. The cos_sim(x,y) function is used to calculate the cosine similarity, which measures the angle between vectors x and y, taking values ​​in the range [-1,1]. A larger value of cos_sim(x,y) indicates greater similarity between vectors x and y. Specifically, cos_sim(x,y) is the ratio of the dot product of vectors x and y to the first value, which is the product of the magnitudes of vectors x and y. Specifically, cos_sim(x,y) satisfies the following formula:

[0126]

[0127] It should be noted that when obtaining user question answers based on the fine-tuned language representation model, it can solve the problem of anisotropy in the embedding expression distribution of the language representation model under small-scale dataset training, as well as the problems of frequent model training, unstable model inference interface, and delayed algorithm response when a small amount of new question and answer data is added.

[0128] In summary, Figure 7In the illustrated embodiment, based on the Dropout mask mechanism in the encoding layer of the language representation model, different text embedding vectors are obtained for the same question. While maximizing the objective optimization function, the batch size and dropout rate of the language representation model are updated to obtain a fine-tuned language representation model. Then, based on the fine-tuned language representation model, the target question vector and reference question vectors for each reference question are obtained. When obtaining the similarity between the target question vector and each reference question vector, the cosine similarity matching between the target question vector and each reference question vector is performed using the objective optimization function. This allows multiple reference question vectors with a similarity to the target question vector within a second preset range to be selected from the question-answering knowledge base. Then, based on each reference question vector and the question-answering knowledge base, each reference question and each reference answer corresponding to each reference question vector is obtained. This allows for the acquisition of reference questions that are closest to the target question, thus improving the accuracy of the answer when determining the target answer from the reference answer results.

[0129] In conjunction with the above, in one embodiment, such as Figure 8 The diagram illustrates a flowchart of an intelligent dialogue method, which includes the following steps:

[0130] S802, Obtain the user's target problem to be solved.

[0131] S804, determine whether the keywords in the target problem include sensitive words.

[0132] Specifically, if it is determined that the keywords in the target problem include sensitive words, S806 is executed, and then S802 is re-executed based on the user's re-entered problem. If it is determined that the keywords in the target problem do not include sensitive words, S808-S810 are executed.

[0133] S806, requesting the user to re-enter the unresolved issue.

[0134] S808: Obtain multiple candidate words corresponding to the keywords in the target problem to be solved, as well as each candidate question corresponding to each candidate word.

[0135] S810, based on the similarity between each candidate question and the target problem to be solved, select each reference question and the corresponding reference response result from each candidate question.

[0136] S812, determine whether the maximum similarity between multiple reference problems and the target problem to be solved is greater than or equal to the first threshold.

[0137] Specifically, if the maximum similarity between multiple reference problems and the target problem is greater than or equal to a first threshold, then proceed to step S814. If the maximum similarity between multiple reference problems and the target problem is less than the first threshold, then proceed to step S816.

[0138] S814, determine the reference response result of the reference question corresponding to the maximum similarity as the target response result of the target unsolved problem.

[0139] S816, determine whether the minimum similarity between multiple reference problems and the target problem to be solved is greater than or equal to a second threshold.

[0140] Specifically, if the minimum similarity between multiple reference problems and the target problem is less than a second threshold, then proceed to step S818. If the minimum similarity between multiple reference problems and the target problem is greater than or equal to the second threshold, then proceed to step S820.

[0141] S818, connect to human customer service.

[0142] S820 displays the reference answers to multiple reference questions.

[0143] The specific details of S802 to S820 can be found in the aforementioned description and will not be repeated here.

[0144] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0145] Based on the same inventive concept, this application also provides an intelligent dialogue device for implementing the intelligent dialogue method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more intelligent dialogue device embodiments provided below can be found in the limitations of the intelligent dialogue method described above, and will not be repeated here.

[0146] In one embodiment, such as Figure 9As shown, an intelligent dialogue device is provided, comprising: a first acquisition module 902, a second acquisition module 904, and a processing module 906, wherein:

[0147] The first acquisition module 902 is used to acquire the user's target problem to be solved;

[0148] The second acquisition module 904 is used to preprocess the target problem to be solved and obtain multiple reference problems corresponding to the target problem to be solved and the reference response results corresponding to each reference problem.

[0149] Processing module 906 is used to determine the target response result for the target problem based on the similarity between the target problem and each reference problem, from the reference response results.

[0150] In one embodiment, the second acquisition module 904 is further configured to: acquire keywords in the target problem to be solved; when it is determined that the keywords are outside the sensitive word library, acquire multiple candidate words with the same meaning as the keywords; obtain each candidate question corresponding to each candidate word based on each candidate word and the question-and-answer knowledge base; and obtain each reference question and each reference answer result corresponding to each reference question from each candidate question based on the similarity between the target problem to be solved and each candidate question.

[0151] In one embodiment, the second acquisition module 904 is further configured to: select multiple candidate questions from the candidate questions whose similarity to the target problem is within a first preset range based on the similarity between the target problem and each candidate question, and obtain each reference question and each reference answer corresponding to each reference question.

[0152] In one embodiment, the second acquisition module 904 is further configured to: obtain each candidate word frequency matrix corresponding to each candidate question and the target word frequency matrix of the target question; and fuse each candidate word frequency matrix and the target word frequency matrix according to the representational semantic matching model to obtain the similarity between multiple candidate questions and the target question.

[0153] In one embodiment, the processing module 906 is further configured to: obtain user feedback on the target response result; if the feedback result indicates that the target unresolved problem has been solved, store the target unresolved problem and the corresponding target response result in a positive sample set; the positive sample set includes a sample set whose unresolved problem is semantically identical to the problem in the question-and-answer knowledge base; if the feedback result indicates that the target unresolved problem has not been solved, store the target unresolved problem and the corresponding target response result in a negative sample set; the negative sample set includes a sample set whose unresolved problem is semantically different from the problem in the question-and-answer knowledge base; and update the representational semantic matching model based on the positive sample set and the negative sample set, with the goal of minimizing the loss function of the representational semantic matching model.

[0154] In one embodiment, the second acquisition module 904 is further configured to: obtain a target question vector for the target problem to be solved based on the fine-tuned language representation model; select multiple reference question vectors from the question-answering knowledge base whose similarity to the target question vector is within a second preset range based on the similarity between the target question vector and the question vectors in the question-answering knowledge base; and obtain each reference question corresponding to each reference question vector and each reference answer corresponding to each reference question based on each reference question vector and the question-answering knowledge base.

[0155] In one embodiment, the second acquisition module 904 is further configured to: acquire training problem samples; acquire a first embedding expression vector obtained after the training problem samples are first input into the language representation model; acquire a second embedding expression vector obtained after the training problem samples are second input into the language representation model; and update the batch size and loss rate of the language representation model based on the first and second embedding expression vectors while maximizing the objective optimization function to obtain a fine-tuned language representation model.

[0156] In one embodiment, the processing module 906 is further configured to: if the maximum similarity between multiple reference questions and the target problem to be solved is greater than or equal to a first threshold, then determine the reference response result of the reference question corresponding to the maximum similarity as the target response result of the target problem to be solved.

[0157] In one embodiment, the processing module 906 is further configured to: access human customer service if the maximum similarity between multiple reference questions and the target problem to be solved is less than a first threshold, and the minimum similarity between multiple reference questions and the target problem to be solved is less than a second threshold; wherein the second threshold is less than the first threshold.

[0158] Each module in the aforementioned intelligent dialogue device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0159] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores representational semantic matching models and fine-tuned language representation models. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an intelligent dialogue method.

[0160] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0161] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0162] The goal of acquiring users remains to be addressed;

[0163] Preprocess the target problem to be solved to obtain multiple reference problems corresponding to the target problem to be solved and the reference response results corresponding to each reference problem;

[0164] Based on the similarity between the target problem and each reference problem, the target response result for the target problem is determined from the results of each reference response.

[0165] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining keywords in the target problem; when it is determined that the keywords are outside the sensitive word library, obtaining multiple candidate words with the same meaning as the keywords; obtaining each candidate question corresponding to each candidate word based on each candidate word and the question-answering knowledge base; and obtaining each reference question and each reference answer result corresponding to each reference question from each candidate question based on the similarity between the target problem and each candidate question.

[0166] In one embodiment, when the processor executes the computer program, it further performs the following steps: based on the similarity between the target problem and each candidate problem, selects multiple candidate problems from each candidate problem whose similarity to the target problem falls within a first preset range, and obtains each reference problem and each reference answer corresponding to each reference problem.

[0167] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining each candidate word frequency matrix corresponding to each candidate question and the target word frequency matrix of the target question; and fusing each candidate word frequency matrix and the target word frequency matrix according to a representational semantic matching model to obtain the similarity between multiple candidate questions and the target question.

[0168] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining user feedback on the target response result; if the feedback result indicates that the target unresolved problem has been solved, storing the target unresolved problem and the corresponding target response result in a positive sample set; the positive sample set includes a sample set whose unresolved problem is semantically identical to the problem in the question-and-answer knowledge base; if the feedback result indicates that the target unresolved problem has not been solved, storing the target unresolved problem and the corresponding target response result in a negative sample set; the negative sample set includes a sample set whose unresolved problem is semantically different from the problem in the question-and-answer knowledge base; and updating the representational semantic matching model based on the positive sample set and the negative sample set, with the goal of minimizing the loss function of the representational semantic matching model.

[0169] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining a target question vector for the target problem to be solved based on the fine-tuned language representation model; selecting multiple reference question vectors from the question-answering knowledge base whose similarity to the target question vector is within a second preset range based on the similarity between the target question vector and the question vectors in the question-answering knowledge base; and obtaining each reference question corresponding to each reference question vector and each reference answer corresponding to each reference question based on each reference question vector and the question-answering knowledge base.

[0170] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining training problem samples; obtaining a first embedding expression vector after the training problem samples are first input into the language representation model; obtaining a second embedding expression vector after the training problem samples are second input into the language representation model; and updating the batch size and loss rate of the language representation model based on the first and second embedding expression vectors while maximizing the objective optimization function, to obtain a fine-tuned language representation model.

[0171] In one embodiment, when the processor executes the computer program, it further implements the following steps: if the maximum similarity between multiple reference questions and the target problem to be solved is greater than or equal to a first threshold, then the reference answer result of the reference question corresponding to the maximum similarity is determined as the target answer result of the target problem to be solved.

[0172] In one embodiment, when the processor executes the computer program, it further performs the following steps: if the maximum similarity between multiple reference questions and the target problem to be solved is less than a first threshold, and the minimum similarity between multiple reference questions and the target problem to be solved is less than a second threshold, then accessing a human customer service representative; wherein the second threshold is less than the first threshold.

[0173] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0174] The goal of acquiring users remains to be addressed;

[0175] Preprocess the target problem to be solved to obtain multiple reference problems corresponding to the target problem to be solved and the reference response results corresponding to each reference problem;

[0176] Based on the similarity between the target problem and each reference problem, the target response result for the target problem is determined from the results of each reference response.

[0177] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining keywords in the target problem; when it is determined that the keywords are outside the sensitive word library, obtaining multiple candidate words with the same meaning as the keywords; obtaining each candidate question corresponding to each candidate word based on each candidate word and the question-answering knowledge base; and obtaining each reference question and each reference answer result corresponding to each reference question from each candidate question based on the similarity between the target problem and each candidate question.

[0178] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: selecting multiple candidate problems from the candidate problems whose similarity to the target problem is within a first preset range, based on the similarity between the target problem and each candidate problem, to obtain each reference problem and each reference answer corresponding to each reference problem.

[0179] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining each candidate word frequency matrix corresponding to each candidate question and the target word frequency matrix of the target question; and fusing each candidate word frequency matrix and the target word frequency matrix according to the representational semantic matching model to obtain the similarity between multiple candidate questions and the target question.

[0180] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining user feedback on the target response; if the feedback indicates that the target problem has been solved, storing the target problem and the corresponding target response in a positive sample set; the positive sample set includes a set of samples where the problem is semantically identical to the problem in the question-and-answer knowledge base; if the feedback indicates that the target problem has not been solved, storing the target problem and the corresponding target response in a negative sample set; the negative sample set includes a set of samples where the problem is semantically different from the problem in the question-and-answer knowledge base; and updating the representational semantic matching model based on the positive and negative sample sets, with the goal of minimizing the loss function of the representational semantic matching model.

[0181] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining a target question vector for the target problem to be solved based on the fine-tuned language representation model; selecting multiple reference question vectors from the question-answering knowledge base whose similarity to the target question vector is within a second preset range based on the similarity between the target question vector and the question vectors in the question-answering knowledge base; and obtaining each reference question corresponding to each reference question vector and each reference answer corresponding to each reference question based on each reference question vector and the question-answering knowledge base.

[0182] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining training problem samples; obtaining a first embedding expression vector after the training problem samples are first input into the language representation model; obtaining a second embedding expression vector after the training problem samples are second input into the language representation model; and updating the batch size and loss rate of the language representation model based on the first and second embedding expression vectors while maximizing the objective optimization function, thereby obtaining a fine-tuned language representation model.

[0183] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the maximum similarity between multiple reference questions and the target problem to be solved is greater than or equal to a first threshold, then the reference answer result of the reference question corresponding to the maximum similarity is determined as the target answer result of the target problem to be solved.

[0184] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the minimum similarity between multiple reference questions and the target problem to be solved is less than a second threshold, access human customer service; wherein the second threshold is less than the first threshold.

[0185] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0186] The goal of acquiring users remains to be addressed;

[0187] Preprocess the target problem to be solved to obtain multiple reference problems corresponding to the target problem to be solved and the reference response results corresponding to each reference problem;

[0188] Based on the similarity between the target problem and each reference problem, the target response result for the target problem is determined from the results of each reference response.

[0189] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining keywords in the target problem; when it is determined that the keywords are outside the sensitive word library, obtaining multiple candidate words with the same meaning as the keywords; obtaining each candidate question corresponding to each candidate word based on each candidate word and the question-answering knowledge base; and obtaining each reference question and each reference answer result corresponding to each reference question from each candidate question based on the similarity between the target problem and each candidate question.

[0190] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: selecting multiple candidate problems from the candidate problems whose similarity to the target problem is within a first preset range, based on the similarity between the target problem and each candidate problem, to obtain each reference problem and each reference answer corresponding to each reference problem.

[0191] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining each candidate word frequency matrix corresponding to each candidate question and the target word frequency matrix of the target question; and fusing each candidate word frequency matrix and the target word frequency matrix according to the representational semantic matching model to obtain the similarity between multiple candidate questions and the target question.

[0192] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining user feedback on the target response; if the feedback indicates that the target problem has been solved, storing the target problem and the corresponding target response in a positive sample set; the positive sample set includes a set of samples where the problem is semantically identical to the problem in the question-and-answer knowledge base; if the feedback indicates that the target problem has not been solved, storing the target problem and the corresponding target response in a negative sample set; the negative sample set includes a set of samples where the problem is semantically different from the problem in the question-and-answer knowledge base; and updating the representational semantic matching model based on the positive and negative sample sets, with the goal of minimizing the loss function of the representational semantic matching model.

[0193] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining a target question vector for the target problem to be solved based on the fine-tuned language representation model; selecting multiple reference question vectors from the question-answering knowledge base whose similarity to the target question vector is within a second preset range based on the similarity between the target question vector and the question vectors in the question-answering knowledge base; and obtaining each reference question corresponding to each reference question vector and each reference answer corresponding to each reference question based on each reference question vector and the question-answering knowledge base.

[0194] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining training problem samples; obtaining a first embedding expression vector after the training problem samples are first input into the language representation model; obtaining a second embedding expression vector after the training problem samples are second input into the language representation model; and updating the batch size and loss rate of the language representation model based on the first and second embedding expression vectors while maximizing the objective optimization function, thereby obtaining a fine-tuned language representation model.

[0195] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the maximum similarity between multiple reference questions and the target problem to be solved is greater than or equal to a first threshold, then the reference answer result of the reference question corresponding to the maximum similarity is determined as the target answer result of the target problem to be solved.

[0196] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the maximum similarity between multiple reference questions and the target problem to be solved is less than a first threshold, and the minimum similarity between multiple reference questions and the target problem to be solved is less than a second threshold, then accessing human customer service; wherein the second threshold is less than the first threshold.

[0197] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0198] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0199] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An intelligent dialog method, characterized by, The method comprises: acquiring a target problem to be solved by a user; preprocessing the target problem to be solved to obtain a plurality of reference problems corresponding to the target problem to be solved and reference reply results corresponding to each of the reference problems; determining a target reply result of the target problem to be solved from the reference reply results according to a representation semantic matching model and a similarity between the target problem to be solved and each of the reference problems; wherein the preprocessing of the target problem to be solved to obtain the plurality of reference problems corresponding to the target problem to be solved and the reference reply results corresponding to each of the reference problems comprises: obtaining a target problem vector of the target problem to be solved according to a fine-tuned language representation model; selecting a plurality of reference problem vectors having a similarity to the target problem vector within a second preset range from a question and answer knowledge base according to the similarity between the target problem vector and problem vectors in the question and answer knowledge base; and obtaining each of the reference problems corresponding to each of the reference problem vectors and each of the reference reply results corresponding to each of the reference problems according to each of the reference problem vectors and the question and answer knowledge base; the fine-tuned language representation model is obtained in the following manner: acquiring a training problem sample; acquiring a first embedding expression vector obtained by inputting the training problem sample into a language representation model for the first time; acquiring a second embedding expression vector obtained by inputting the training problem sample into the language representation model for the second time; and updating a batch size and a loss rate of the language representation model when maximizing a target optimization function according to the first embedding expression vector and the second embedding expression vector to obtain the fine-tuned language representation model; the method further comprises: acquiring a feedback result of the target reply result by the user; if the feedback result indicates that the target problem to be solved has been solved, storing the target problem to be solved and the corresponding target reply result into a positive sample set; the positive sample set comprises a sample set in which a problem to be solved has the same semantics as a problem in the question and answer knowledge base; if the feedback result indicates that the target problem to be solved has not been solved, storing the target problem to be solved and the corresponding target reply result into a negative sample set; the negative sample set comprises a sample set in which a problem to be solved has different semantics from a problem in the question and answer knowledge base; and updating the representation semantic matching model with the loss function of the representation semantic matching model being minimized as the target according to the positive sample set and the negative sample set.

2. The method of claim 1, wherein, The method further comprises: acquiring a keyword in the target problem to be solved; when it is determined that the keyword is outside a sensitive word library, acquiring a plurality of candidate words having the same word meaning as the keyword; obtaining each candidate problem corresponding to each of the candidate words according to each of the candidate words and a question and answer knowledge base; obtaining each of the reference problems and each of the reference reply results corresponding to each of the reference problems from each of the candidate problems according to a similarity between the target problem to be solved and each of the candidate problems.

3. The method of claim 2, wherein, The obtaining of the reference question and the reference reply corresponding to each reference question from each candidate question according to the similarity between the target problem to be solved and each candidate question comprises: According to the similarity between the target problem to be solved and each candidate question, a plurality of candidate questions with a similarity within a first preset range to the target problem to be solved are selected from each candidate question, each reference question is obtained, and each reference reply corresponding to each reference question is obtained.

4. The method of claim 2, wherein, The similarity between the target problem to be solved and each candidate question is obtained in the following manner: Each candidate word frequency matrix corresponding to each candidate question and a target word frequency matrix of the target problem to be solved are obtained. According to a typomorphic semantic matching model, the target word frequency matrix and each candidate word frequency matrix are fused to obtain the similarity between the target problem to be solved and each candidate question.

5. The method of claim 1, wherein, The target reply result of the target problem to be solved is determined from each reference reply result according to the similarity between the target problem to be solved and each reference question, which comprises: If the maximum similarity between the plurality of reference questions and the target problem to be solved is greater than or equal to a first threshold value, the reference reply result of the reference question corresponding to the maximum similarity is determined as the target reply result of the target problem to be solved.

6. The method of claim 5, wherein, The method further comprises: If the maximum similarity between the plurality of reference questions and the target problem to be solved is less than the first threshold value, and the minimum similarity between the plurality of reference questions and the target problem to be solved is less than a second threshold value, an artificial customer service is accessed; wherein the second threshold value is less than the first threshold value.

7. An intelligent dialog apparatus characterized by comprising: The device comprises: A first obtaining module is configured to obtain a target problem to be solved of a user. A second obtaining module is configured to preprocess the target problem to be solved to obtain a plurality of reference questions corresponding to the target problem to be solved and a reference reply result corresponding to each reference question. A processing module is configured to determine a target reply result of the target problem to be solved from each reference reply result according to a typomorphic semantic matching model and the similarity between the target problem to be solved and each reference question. The second obtaining module is further configured to obtain a target question vector of the target problem to be solved according to a fine-tuned language representation model, select a plurality of reference question vectors with a similarity within a second preset range to the target question vector from a question and answer knowledge base according to the similarity between the target question vector and a question vector in the question and answer knowledge base, and obtain each reference question corresponding to each reference question vector and each reference reply result corresponding to each reference question according to each reference question vector and the question and answer knowledge base. The second obtaining module is further configured to: obtain a training question sample; obtain a first embedding expression vector obtained after the training question sample is input into a language representation model for the first time; obtain a second embedding expression vector obtained after the training question sample is input into the language representation model for the second time; and update a batch size and a loss rate of the language representation model when a target optimization function is maximized according to the first embedding expression vector and the second embedding expression vector, to obtain a fine-tuned language representation model. The processing module is further configured to: obtain a feedback result of the user for the target reply result; if the feedback result indicates that the target problem to be solved has been solved, store the target problem to be solved and the corresponding target reply result into a positive sample set; the positive sample set includes a sample set in which a problem to be solved is semantically identical to a question in the question and answer knowledge base; if the feedback result indicates that the target problem to be solved has not been solved, store the target problem to be solved and the corresponding target reply result into a negative sample set; the negative sample set includes a sample set in which a problem to be solved is semantically different from a question in the question and answer knowledge base; and update the representation type semantic matching model according to the positive sample set and the negative sample set, with the loss function of the representation type semantic matching model being minimized as the target.

8. The apparatus of claim 7, wherein, The second obtaining module is further configured to: obtain a keyword in the target problem to be solved; when it is determined that the keyword is outside the sensitive word library, obtain a plurality of candidate words with the same word meaning as the keyword; obtain a plurality of candidate questions corresponding to the plurality of candidate words according to the plurality of candidate words and the question and answer knowledge base; obtain a plurality of reference questions and a plurality of reference reply results corresponding to the plurality of reference questions from the plurality of candidate questions according to a similarity between the target problem to be solved and the plurality of candidate questions.

9. The apparatus of claim 8, wherein, The second obtaining module is further configured to: select a plurality of candidate questions with a similarity to the target problem to be solved within a first preset range from the plurality of candidate questions according to a similarity between the target problem to be solved and the plurality of candidate questions, obtain a plurality of reference questions, and a plurality of reference reply results corresponding to the plurality of reference questions.

10. The apparatus of claim 8, wherein, The second obtaining module is further configured to: obtain a plurality of candidate term frequency matrices corresponding to the plurality of candidate questions and a target term frequency matrix of the target problem to be solved; fuse the plurality of candidate term frequency matrices and the target term frequency matrix according to a representation type semantic matching model to obtain a similarity between the target problem to be solved and the plurality of candidate questions.

Citation Information

Patent Citations

  • Man-machine interaction method and system based on artificial intelligence

    CN105068661A

  • Automatic question and answer selection method based on question topics

    CN110287298A