Intelligent dialogue method, device and electronic equipment
By querying the database and the availability judgment model to generate the current response content of the intelligent dialogue, the problem of the response content in the intelligent customer service not meeting expectations is solved, and the efficiency and accuracy of the dialogue are improved.
Patent Information
- Application Number
- CN202411605385.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-11
AI Technical Summary
During the conversation between the intelligent customer service and the object, the semantics of the current question is quite different from the semantics of specific historical questions, resulting in the response content not meeting expectations and reducing the efficiency of the conversation.
By obtaining the current question, querying the database for matching candidate reference questions and their intervention response content, and using the availability judgment model to determine the availability of the intervention response content, the current response content is generated when available, and combined with the generative large language model to improve the matching and consistency of the response content.
It improves the efficiency of intelligent dialogue, ensures the matching and consistency of the response content with the current question, and improves the accuracy and effectiveness of the dialogue.
Smart Images

Figure CN119597873B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to technical fields such as deep learning, natural language processing, and large models, and in particular to an intelligent dialogue method, device, and electronic device. Background Art
[0002] Currently, during the conversation between the intelligent customer service and the object, for the object's current question, the intelligent customer service determines whether the current question contains specific keywords in specific historical questions; among which, the specific historical questions are historical questions with intervention reply content; when the current question contains specific keywords, the intervention reply content is determined as the reply content corresponding to the current question.
[0003] In the above scheme, when the current question contains specific keywords from a specific historical question, the semantics of the current question and the semantics of the specific historical question may be significantly different, resulting in the answer content not being the expected answer content for the current question and poor dialogue efficiency. Summary of the Invention
[0004] The present disclosure provides an intelligent dialogue method, device, and electronic device.
[0005] According to one aspect of the present disclosure, an intelligent dialogue method is provided, which includes: obtaining a current question in a dialogue process; querying a first database based on the current question to obtain candidate reference questions matching the current question in the first database, and first intervention reply content corresponding to the candidate reference question; the first database includes various reference questions and intervention reply content corresponding to the reference questions; determining whether the first intervention reply content is available based on the current question, the first intervention reply content and an availability judgment model; and generating current reply content corresponding to the current question based on the current question and the first intervention reply content if the first intervention reply content is available.
[0006] According to another aspect of the present disclosure, an intelligent dialogue device is provided, which includes: a first acquisition module for acquiring a current question in a dialogue process; a second acquisition module for querying a first database based on the current question to acquire candidate reference questions matching the current question in the first database, and first intervention reply content corresponding to the candidate reference questions; the first database includes various reference questions and intervention reply content corresponding to the reference questions; a first determination module for determining whether the first intervention reply content is available based on the current question, the first intervention reply content and an availability judgment model; and a first generation module for generating current reply content corresponding to the current question based on the current question and the first intervention reply content if the first intervention reply content is available.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the intelligent dialogue method proposed above in the present disclosure.
[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the intelligent dialogue method proposed above in the present disclosure.
[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the steps of the intelligent dialogue method proposed above in the present disclosure when executed by a processor.
[0010] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0012] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0013] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0014] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;
[0015] Figure 4This is a schematic diagram of multiple rounds of intervention in intelligent dialogue;
[0016] Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0017] Figure 6 It is a block diagram of an electronic device used to implement the intelligent dialogue method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0019] Currently, during the conversation between the intelligent customer service and the object, for the object's current question, the intelligent customer service determines whether the current question contains specific keywords in specific historical questions; among which, the specific historical questions are historical questions with intervention reply content; when the current question contains specific keywords, the intervention reply content is determined as the reply content corresponding to the current question.
[0020] In the above scheme, when the current question contains specific keywords from a specific historical question, the semantics of the current question and the semantics of the specific historical question may be significantly different, resulting in the answer content not being the expected answer content for the current question and poor dialogue efficiency.
[0021] In response to the above problems, the present disclosure proposes an intelligent dialogue method, device and electronic device.
[0022] Figure 1 This is a schematic diagram according to the first embodiment of the present disclosure. It should be noted that the intelligent conversation method of this embodiment can be applied to an intelligent conversation device, which can be configured in an electronic device to enable the electronic device to perform intelligent conversation functions. The following embodiments are described using an electronic device as an example.
[0023] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a smart speaker, a server, a server cluster, an intelligent body, and other hardware devices with various operating systems, touch screens and / or display screens.
[0024] The intelligent dialogue device may also be software in an electronic device, such as intelligent dialogue software, etc. In the following embodiments, the intelligent dialogue device is described as an electronic device.
[0025] like Figure 1 As shown, the intelligent dialogue method may include the following steps:
[0026] Step 101: Obtain the current question in the conversation process.
[0027] In the embodiment of the present disclosure, the conversation process may be a conversation process between an object and an electronic device, wherein the current question may be a question currently input by the object during the conversation process; or a question currently collected by the object during the conversation process.
[0028] Step 102: query the first database based on the current question to obtain candidate reference questions in the first database that match the current question, and first intervention response content corresponding to the candidate reference questions; the first database includes various reference questions and intervention response content corresponding to the reference questions.
[0029] In an embodiment of the present disclosure, in one example, the process of the electronic device executing step 102 may, for example, be to determine the similarity between the reference question and the current question for each reference question in the first database; sort the reference questions in descending order according to the similarity to obtain a sorting result; determine a preset number of reference questions at the top of the sorting result as candidate reference questions; and obtain the first intervention reply content corresponding to the candidate reference questions in the first database.
[0030] In another example, the process of the electronic device executing step 102 may be, for example, determining the similarity between the reference question and the current question for each reference question in the first database; determining the reference questions whose corresponding similarity is greater than or equal to a preset similarity threshold as candidate reference questions; and obtaining the first intervention response content corresponding to the candidate reference questions in the first database.
[0031] The similarity between the reference question and the current question can be determined based on a combination of keywords in the reference question and keywords in the current question. For example, the electronic device can determine a first number of identical keywords in the keywords in the reference question and the keywords in the current question; determine a second number of keywords in the current question; and determine the ratio of the first number to the second number as the similarity between the reference question and the current question.
[0032] In the embodiment of the present disclosure, the first database can be determined by the electronic device, or can be determined by other devices that communicate with the electronic device. Taking the electronic device determining the first database as an example, the process of the electronic device determining the first database can be, for example, determining the intervention party; providing an interactive interface to the intervention party to provide the intervention party with historical conversation records through the interactive interface, and receiving intervention information returned by the intervention party. The intervention information may include historical questions in the historical conversation records and intervention response content corresponding to the historical questions. The electronic device can determine the first database by combining multiple intervention information.
[0033] It should be noted that the conversation between an electronic device and an object can be triggered by an advertisement, link, or other mechanism. The content displayed by the advertisement or link is relevant content of the intervening party. Accordingly, the conversation between the electronic device and the object involves content related to the intervening party. Therefore, the intervening party can be the owner of the content displayed by the advertisement or link that triggered the conversation.
[0034] Step 103 : Determine whether the first intervention response content is available based on the current question, the first intervention response content, and the availability judgment model.
[0035] In the embodiment of the present disclosure, the process of the electronic device executing step 103 may, for example, be to input the current question and the first intervention reply content into the availability judgment model, obtain the availability judgment result output by the availability judgment model; and determine whether the first intervention reply content is available based on the availability judgment result.
[0036] The availability determination result may be a specific numerical value. Different numerical values may represent different availability determination results. For example, when the availability determination result is a first numerical value, it indicates that the first intervention reply content is available; and when the availability determination result is a second numerical value, it indicates that the first intervention reply content is unavailable.
[0037] The first intervention reply content being available may indicate that the current question and the first intervention reply content have a high degree of match, and the first intervention reply content can be used as the current reply content corresponding to the current question. The first intervention reply content being unavailable may indicate that the current question and the first intervention reply content have a low degree of match, and the first intervention reply content cannot be used as the current reply content corresponding to the current question.
[0038] In the disclosed embodiment, the availability judgment model can be obtained by fine-tuning the generative large language model based on training data. The training data may include sample questions, sample intervention response content, and availability.
[0039] The availability of the first intervention response is determined by combining the availability judgment model with the current question. The availability judgment model has a large number of parameters and high accuracy, which can further accurately determine the match between the first intervention response and the current question. This further improves the match between the determined current response and the current question, further enhancing conversation efficiency.
[0040] Step 104 : When the first intervention reply content is available, generate current reply content corresponding to the current question according to the current question and the first intervention reply content.
[0041] In an embodiment of the present disclosure, when the number of available first intervention reply contents is single, the process of the electronic device executing step 104 may, for example, be to input the current question and the first intervention reply content into the generative large language model, and obtain the current reply content output by the generative large language model.
[0042] In an embodiment of the present disclosure, when there are multiple available first intervention reply contents, the process for the electronic device to execute step 104 may, for example, be to select one candidate reference question from multiple candidate reference questions based on the degree of match between the candidate reference question corresponding to the available first intervention reply content and the current question; input the first intervention reply content corresponding to the selected candidate reference question and the current question into the generative large language model, and obtain the current reply content output by the generative large language model.
[0043] The degree of matching between the candidate reference question corresponding to the available first intervention reply content and the current question may be the degree of similarity between the candidate reference question and the current question in step 102 .
[0044] Among them, the electronic device can combine the matching degree to sort the candidate reference questions corresponding to the multiple available first intervention response contents in descending order to obtain a sorting result; and determine the candidate reference question ranked first in the sorting result as the selected candidate reference question.
[0045] This process involves selecting a candidate reference question from multiple candidate reference questions based on the match between the candidate reference questions corresponding to the available first intervention response and the current question, and then determining the current response. This can further improve the match between the determined current response and the current question. Furthermore, combining a generative large language model, the current question, and the first intervention response to generate the current response ensures consistency in style between the current question and the current response, further improving conversational efficiency.
[0046] In the embodiments of the present disclosure, it should also be noted that when no available first intervention reply content is obtained, the electronic device can generate the current reply content corresponding to the current question in combination with the current question; or, the electronic device can generate the current reply content corresponding to the current question in combination with the current question and the historical conversation content.
[0047] The intelligent dialogue method of the embodiment of the present disclosure obtains the current question in the dialogue process; queries the first database according to the current question to obtain the candidate reference question matching the current question in the first database, and the first intervention reply content corresponding to the candidate reference question; the first database includes various reference questions and the intervention reply content corresponding to the reference questions; determines whether the first intervention reply content is available according to the current question, the first intervention reply content and the availability judgment model; and generates the current reply content corresponding to the current question according to the current question and the first intervention reply content when the first intervention reply content is available; wherein, the candidate reference question is selected based on the matching degree between the current question and the reference question, and then the intervention reply content is selected based on whether the intervention reply content corresponding to the candidate reference question is available to generate the current reply content, which can ensure that the current reply content is the expected reply content for the current question, thereby improving the dialogue efficiency.
[0048] In order to further improve the matching degree between the current question and the candidate reference questions, and thus further improve the accuracy of the current answer content, the candidate reference questions can also be selected based on the vector similarity between the current question vector of the current question and the reference question vector of the reference question. Figure 2 As shown, Figure 2 is a schematic diagram according to a second embodiment of the present disclosure, Figure 2 The illustrated embodiment may include the following steps:
[0049] Step 201: Obtain the current question in the conversation process.
[0050] Step 202: Determine the current question vector of the current question.
[0051] In the embodiment of the present disclosure, the vector extraction method for determining the current question vector may include at least one of the following: a word-based vector representation model (Word2Vec), a word-based ranking model (WordRank), a general text representation vector model (General Text Embedding, GTE), a vector model (embedding) in a generative large language model, etc., which can be selected according to actual needs and is not specifically limited here.
[0052] Step 203: query the first database based on the current question vector to obtain a reference question vector in the first database that matches the current question vector; the first database includes various reference questions, reference question vectors of the reference questions, and intervention response content corresponding to the reference questions.
[0053] Among them, the reference question vectors of the reference questions in the first database can also be extracted and processed based on at least one of the above-mentioned vector extraction methods, which is not specifically limited here.
[0054] In an embodiment of the present disclosure, in one example, the process of the electronic device executing step 203 may, for example, be to determine the vector similarity between the current question vector and each reference question vector in the first database; and determine the reference question vector whose corresponding vector similarity is greater than or equal to the first similarity threshold as the reference question vector that matches the current question vector.
[0055] Among them, combining the vector similarity between the current question vector and each reference question vector in the first database, selecting a matching reference question vector from each reference question vector can further improve the matching degree between the reference question vector and the current question vector, thereby further improving the matching degree between the candidate reference question and the current question.
[0056] In another example, the process of the electronic device executing step 203 may, for example, be to determine the vector similarity between the current question vector and each reference question vector in the first database; sort each reference question vector in the first database in descending order according to the vector similarity to obtain a sorting result; and determine a certain number of reference question vectors ranked at the top in the sorting result as reference question vectors that match the current question vector.
[0057] In addition, the electronic device may also combine an approximate nearest neighbor search (ANN) algorithm to determine a reference question vector in the first database that matches the current question vector. The approximate nearest neighbor search algorithm, such as a locality sensitive hashing algorithm, a vector quantization algorithm, a graph embedding method, etc., may be set according to actual needs.
[0058] Step 204: Determine the reference question corresponding to the matched reference question vector as a candidate reference question.
[0059] Step 205: Obtain the first intervention response content corresponding to the candidate reference question in the first database.
[0060] Step 206 : Determine whether the first intervention response content is available based on the current question, the first intervention response content, and the availability judgment model.
[0061] Step 207 : When the first intervention reply content is available, generate the current reply content corresponding to the current question according to the current question and the first intervention reply content.
[0062] In an embodiment of the present disclosure, when there are multiple available first intervention reply contents, the process for the electronic device to execute step 207 may, for example, be to obtain a reference question vector of a candidate reference question corresponding to the available first intervention reply content; obtain a current question vector of the current question; select one candidate reference question from each candidate reference question based on the vector similarity between the reference question vector of each candidate reference question and the current question vector; and generate the current reply content corresponding to the current question based on the first intervention reply content corresponding to the selected candidate reference question and the current question.
[0063] Among them, the electronic device can sort the similarities of each vector in descending order to obtain a sorting result; obtain the reference question vector corresponding to the vector similarity ranked first in the sorting result; obtain the candidate reference question corresponding to the reference question vector; combine the first intervention reply content corresponding to the candidate reference question and the current question to generate the current reply content corresponding to the current question.
[0064] It should be noted that the details of step 201, step 206 to step 207 can be found in Figure 1 Step 101, step 103 and step 104 in the illustrated embodiment will not be described in detail here.
[0065] The intelligent dialogue method of the embodiment of the present disclosure obtains the current question in the dialogue process; determines the current question vector of the current question; queries the first database according to the current question vector to obtain the reference question vector matching the current question vector in the first database; the first database includes various reference questions, reference question vectors of the reference questions, and intervention reply content corresponding to the reference questions; determines the reference question corresponding to the matched reference question vector as a candidate reference question; obtains the first intervention reply content corresponding to the candidate reference question in the first database; determines whether the first intervention reply content is available according to the current question, the first intervention reply content and the availability judgment model; if the first intervention reply content is available, generates the current reply content corresponding to the current question according to the current question and the first intervention reply content; wherein, the candidate reference question is selected based on the vector similarity between the current question vector of the current question and the reference question vector of the reference question, and then the intervention reply content is selected to generate the current reply content, which can further ensure the matching degree between the candidate reference question and the current question, thereby improving the accuracy of the current reply content and further improving the dialogue efficiency.
[0066] In order to further improve the matching degree between the current answer content and the current question, if the first database does not obtain the candidate reference question, the current question and the corresponding historical conversation content can be summarized; based on the processed current summary content, the second database is queried to obtain the matching candidate reference summary content, and then the current answer content is determined. Figure 3 As shown, Figure 3 is a schematic diagram according to a third embodiment of the present disclosure, Figure 3 The illustrated embodiment may include the following steps:
[0067] Step 301: Obtain the current question in the conversation process.
[0068] Step 302: query the first database based on the current question to obtain candidate reference questions in the first database that match the current question, and first intervention response content corresponding to the candidate reference questions; the first database includes various reference questions and intervention response content corresponding to the reference questions.
[0069] Step 303: Determine whether the first intervention response content is available based on the current question, the first intervention response content, and the availability judgment model.
[0070] Step 304 : When the first intervention reply content is available, generate current reply content corresponding to the current question according to the current question and the first intervention reply content.
[0071] Step 305: When no candidate reference question is obtained, or when no available first intervention response content is obtained, historical conversation content corresponding to the current question in the conversation process is obtained.
[0072] In the disclosed embodiment, the historical conversation content corresponding to the current question may be the content of multiple rounds of conversations preceding the current question in the conversation process to which the current question belongs. The content of multiple rounds of conversations and the current question may be content under the same topic.
[0073] Step 306: Summarize the current question and the historical conversation content to obtain the current summary content.
[0074] In the embodiment of the present disclosure, the process of the electronic device executing step 306 may, for example, be to input the current question and the historical conversation content into the content summary model, and obtain the current summary content output by the content summary model; the content summary model is obtained by fine-tuning the generative large language model based on the training data; the training data includes sample questions, sample historical conversation content and sample summary content.
[0075] The current summary content can include two parts: historical compressed content and question completion content. The historical compressed content is the content obtained by summarizing the historical conversation content. The question completion content is the content obtained by completing and summarizing the question in combination with the historical conversation content. Correspondingly, the sample summary content can also include sample historical compressed content and sample question completion content, so that the trained content summary model can output historical compressed content and question completion content after inputting the current question and historical conversation content; these two contents are combined to obtain the current summary content.
[0076] Among them, the fine-tuning process of the generative large language model based on training data can be, for example, inputting sample questions and sample historical conversation content into the generative large language model to obtain the prediction summary content output by the generative large language model; combining the sample summary content, the prediction summary content and the loss function to determine the loss function value; and adjusting the parameters of the generative large prediction model based on the loss function value to achieve training.
[0077] Among them, the content summarization model has a large number of parameters and high accuracy. Determining the current summary content based on the content summarization model can further improve the accuracy of the determined current summary content.
[0078] In an embodiment of the present disclosure, a method for obtaining training data may include: obtaining multiple sample questions and sample historical conversation content corresponding to the sample questions; determining prompt content; the prompt content instructs to generate summary content; inputting the sample questions, the sample historical conversation content corresponding to the sample questions, and the prompt content into a generative large language model to obtain sample summary content output by the generative large language model; and combining the sample questions, the sample historical conversation content corresponding to the sample questions, and the sample summary content to obtain training data.
[0079] Among them, the method for obtaining sample questions and corresponding sample historical conversation content can be, for example, collecting historical questions and corresponding historical conversation content from various industries; performing conversation cleaning processing on the collected data, such as ambiguous conversation filtering, low-quality conversation filtering, etc., and determining the filtered historical questions as sample historical questions; and determining the historical conversation content corresponding to the sample historical questions as sample historical conversation content.
[0080] Among them, the prompt content is used to instruct the summary content generation process. That is to say, combined with the prompt content, the generative large language model can understand what content needs to be generated, and then perform the generation process, so as to generate the required sample summary content, thereby improving the determination efficiency and accuracy of the sample summary content and reducing the preparation cost of training data.
[0081] Among them, in order to further ensure the accuracy of the training data, after obtaining the training data, the training data can be provided to the reviewer, and the reviewer will review whether the content of each sample summary in the training data is correct, and then the accuracy of the training data; when the accuracy of the training data is greater than or equal to the accuracy threshold, the training data is retained for training processing; when the accuracy of the training data is less than the accuracy threshold, the prompt content is adjusted, and the sample summary content generation processing is rewritten in combination with the generative large language model until training data with an accuracy greater than or equal to the accuracy threshold is obtained.
[0082] Step 307: query the second database based on the current summary content to obtain candidate reference summary content in the second database that matches the current summary content, as well as second intervention response content corresponding to the candidate reference summary content; the second database includes each reference summary content and the intervention response content corresponding to the reference summary content.
[0083] In an embodiment of the present disclosure, in one example, the process of the electronic device executing step 307 may, for example, include determining, for each reference summary content in the second database, the similarity between the reference summary content and the current summary content; selecting candidate reference summary content from multiple reference summary contents based on the similarity; and obtaining second intervention reply content corresponding to the candidate reference summary content in the second database.
[0084] In another example, the second database may further include a reference summary content vector for the reference summary content. Accordingly, the electronic device may perform step 307 by, for example, determining a current summary content vector for the current summary content; querying the second database based on the current summary content vector to obtain a reference summary content vector in the second database that matches the current summary content vector; determining the reference summary content corresponding to the matching reference summary content vector as the candidate reference summary content; and obtaining the second intervention response content corresponding to the candidate reference summary content in the second database.
[0085] Among them, combining the vector similarity between the current summary content vector and each reference summary content vector in the second database, selecting a matching reference summary content vector from each reference summary content vector can further improve the matching degree between the reference summary content vector and the current summary content vector, thereby further improving the matching degree between the candidate reference summary content and the current summary content.
[0086] In the embodiment of the present disclosure, the second database can be determined by the electronic device, or can be determined by other devices that communicate with the electronic device. Taking the electronic device determining the second database as an example, the process of the electronic device determining the second database can be, for example, determining the intervention party; providing an interactive interface to the intervention party to provide the intervention party with historical conversation records through the interactive interface, and receiving intervention information returned by the intervention party. The intervention information may include historical questions, historical conversation content, and intervention response content in the historical conversation records. The electronic device can determine the second database by combining multiple intervention information.
[0087] It should be noted that the conversation between an electronic device and an object can be triggered by an advertisement, link, or other mechanism. The content displayed by the advertisement or link is relevant content of the intervening party. Accordingly, the conversation between the electronic device and the object involves content related to the intervening party. Therefore, the intervening party can be the owner of the content displayed by the advertisement or link that triggered the conversation.
[0088] In the embodiment of the present disclosure, it should also be noted that when the candidate reference summary content is not obtained, the electronic device can generate the current reply content corresponding to the current question in combination with the current question; or, the electronic device can generate the current reply content in combination with the current summary content.
[0089] Step 308 : Determine whether the second intervention reply content is available based on the current summary content, the second intervention reply content corresponding to the candidate reference summary content, and the availability judgment model.
[0090] In the embodiment of the present disclosure, the process of the electronic device executing step 308 may, for example, be to input the current summary content and the second intervention reply content into the availability judgment model, obtain the availability judgment result output by the availability judgment model; and determine whether the second intervention reply content is available based on the availability judgment result.
[0091] Step 309 : If the second intervention reply content is available, generate the current reply content corresponding to the current question according to the current summary content and the second intervention reply content.
[0092] In an embodiment of the present disclosure, if a single second intervention reply is available, the electronic device can directly input the current summary and the second intervention reply into the generative large language model to obtain the current reply output by the generative large language model. If multiple second intervention reply contents are available, the electronic device can select one second intervention reply from the multiple second intervention reply contents; input the selected second intervention reply and the current summary into the generative large language model to obtain the current reply output by the generative large language model.
[0093] In the embodiments of the present disclosure, it should also be noted that when no available second intervention reply content is obtained, the electronic device can generate the current reply content corresponding to the current question in combination with the current question; or, the electronic device can generate the current reply content in combination with the current summary content.
[0094] It should be noted that the details of steps 301 to 304 can be found in Figure 1 Steps 101 to 104 in the illustrated embodiment will not be described in detail here.
[0095] The intelligent dialogue method of the embodiment of the present disclosure obtains the current question in the dialogue process; queries the first database according to the current question to obtain the candidate reference question matching the current question in the first database, and the first intervention reply content corresponding to the candidate reference question; the first database includes each reference question and the intervention reply content corresponding to the reference question; determines whether the first intervention reply content is available according to the current question, the first intervention reply content and the availability judgment model; if the first intervention reply content is available, generates the current reply content corresponding to the current question according to the current question and the first intervention reply content; if the candidate reference question is not obtained, or if the available first intervention reply content is not obtained, obtains the historical dialogue content corresponding to the current question in the dialogue process; summarizes the current question and the historical dialogue content to obtain the current summary content; queries the second database according to the current summary content to obtain the second database the candidate reference summary content that matches the current summary content in the first database, and the second intervention reply content corresponding to the candidate reference summary content; the second database includes each reference summary content and the intervention reply content corresponding to the reference summary content; according to the current summary content, the second intervention reply content corresponding to the candidate reference summary content and the availability judgment model, determine whether the second intervention reply content is available; when the second intervention reply content is available, generate the current reply content corresponding to the current question according to the current summary content and the second intervention reply content; wherein, in the case that the candidate reference question is not obtained in the first database, the current question and the corresponding historical conversation content can be summarized; based on the processed current summary content, query the second database to obtain the matching candidate reference summary content, and then determine the current reply content, which can further ensure the matching degree between the current reply content and the current question, thereby improving the conversation efficiency.
[0096] The following examples are given to illustrate this. Figure 4 The figure shows a schematic diagram of multiple rounds of intervention in intelligent dialogue. Figure 4The following steps may be included. Step 401, online dialogue (i.e., dialogue process). Step 402, scenario summary (i.e., combining the current question in the dialogue process and the historical dialogue content to determine the current summary content). Step 403, representation extraction (i.e., determining the current summary content vector of the current summary content). Step 404, material recall (i.e., querying the second database based on the current summary content vector to obtain candidate reference summary content and the corresponding second intervention reply content). Step 405, relevance judgment (i.e., determining whether the second intervention reply content is available). Step 406, speech polishing (i.e., combining the available second intervention reply content to generate the current reply content). Step 407, merchant expected reply A (i.e., using the current reply content for reply processing).
[0097] The offline determination of the second database includes the following steps: Step 408: Merchant feedback dialogue (historical questions, historical dialogue content corresponding to the historical questions, and intervention response content). Step 409: Scenario summary (i.e., determining reference summary content based on historical questions and corresponding historical dialogue content). Step 410: Representation extraction (i.e., determining a reference summary content vector for the reference summary content, which is used for matching with the current summary content vector to obtain candidate reference summary content).
[0098] In order to implement the above embodiment, the present disclosure also provides an intelligent dialogue device. Figure 5 As shown, Figure 5 The intelligent dialogue device 50 may include: a first acquisition module 501 , a second acquisition module 502 , a first determination module 503 , and a first generation module 504 .
[0099] Among them, the first acquisition module 501 is used to obtain the current question in the dialogue process; the second acquisition module 502 is used to query the first database according to the current question, and obtain the candidate reference questions matching the current question in the first database, and the first intervention reply content corresponding to the candidate reference questions; the first database includes various reference questions and the intervention reply content corresponding to the reference questions; the first determination module 503 is used to determine whether the first intervention reply content is available based on the current question, the first intervention reply content and the availability judgment model; the first generation module 504 is used to generate the current reply content corresponding to the current question based on the current question and the first intervention reply content when the first intervention reply content is available.
[0100] As a possible implementation method of an embodiment of the present disclosure, the first database also includes a reference question vector of the reference question; the second acquisition module 502 includes a first determination unit, a first acquisition unit, a second determination unit and a second acquisition unit; the first determination unit is used to determine the current question vector of the current question; the first acquisition unit is used to query the first database according to the current question vector, and obtain a reference question vector in the first database that matches the current question vector; the second determination unit is used to determine the reference question corresponding to the matched reference question vector as the candidate reference question; the second acquisition unit is used to obtain the first intervention reply content corresponding to the candidate reference question in the first database.
[0101] As a possible implementation method of an embodiment of the present disclosure, the first acquisition unit is specifically used to determine the vector similarity between the current question vector and each reference question vector in the first database; and determine the reference question vector whose corresponding vector similarity is greater than or equal to the first similarity threshold as the reference question vector that matches the current question vector.
[0102] As a possible implementation method of an embodiment of the present disclosure, the first determination module 503 is specifically used to input the current question and the first intervention response content into the availability judgment model, obtain the availability judgment result output by the availability judgment model; and determine whether the first intervention response content is available based on the availability judgment result.
[0103] As a possible implementation method of an embodiment of the present disclosure, there are multiple available first intervention reply contents; the first generation module 504 is specifically used to select a candidate reference question from multiple candidate reference questions based on the matching degree between the candidate reference question corresponding to the available first intervention reply content and the current question; input the first intervention reply content corresponding to the selected candidate reference question and the current question into the generative large language model to obtain the current reply content output by the generative large language model.
[0104] As a possible implementation of an embodiment of the present disclosure, the device also includes a third acquisition module, a summary processing module, a fourth acquisition module, a second determination module, and a second generation module; the third acquisition module is used to obtain the historical conversation content corresponding to the current question in the conversation process when the candidate reference question is not obtained, or when the available first intervention reply content is not obtained; the summary processing module is used to summarize the current question and the historical conversation content to obtain the current summary content; the fourth acquisition module is used to query the second database based on the current summary content to obtain the candidate reference summary content that matches the current summary content and the second intervention reply content corresponding to the candidate reference summary content in the second database; the second database includes each reference summary content and the intervention reply content corresponding to the reference summary content; the second determination module is used to determine whether the second intervention reply content is available based on the current summary content, the second intervention reply content corresponding to the reference candidate summary content, and the availability judgment model; the second generation module is used to generate the current reply content corresponding to the current question based on the current summary content and the second intervention reply content when the second intervention reply content is available.
[0105] As a possible implementation method of an embodiment of the present disclosure, the summary processing module is specifically used to input the current question and the historical conversation content into a content summary model to obtain the current summary content output by the content summary model; the content summary model is obtained by fine-tuning the generative large language model based on training data; the training data includes sample questions, sample historical conversation content and sample summary content.
[0106] As a possible implementation method of an embodiment of the present disclosure, the method for obtaining the training data includes: obtaining multiple sample questions and sample historical conversation content corresponding to the sample questions; determining prompt content; the prompt content instructs to generate summary content; inputting the sample questions, the sample historical conversation content corresponding to the sample questions, and the prompt content into a generative large language model to obtain sample summary content output by the generative large language model; and combining the sample questions, the sample historical conversation content corresponding to the sample questions, and the sample summary content to obtain the training data.
[0107] As a possible implementation manner of an embodiment of the present disclosure, the second database also includes a reference summary content vector of the reference summary content; the fourth acquisition module is specifically used to determine the current summary content vector of the current summary content; query the second database according to the current summary content vector to obtain a reference summary content vector in the second database that matches the current summary content vector; determine the reference summary content corresponding to the matching reference summary content vector as the candidate reference summary content; and obtain the second intervention reply content corresponding to the candidate reference summary content in the second database.
[0108] The intelligent dialogue device of the embodiment of the present disclosure obtains the current question in the dialogue process; queries the first database according to the current question to obtain the candidate reference question matching the current question in the first database, and the first intervention reply content corresponding to the candidate reference question; the first database includes each reference question and the intervention reply content corresponding to the reference question; determines whether the first intervention reply content is available according to the current question, the first intervention reply content and the availability judgment model; and generates the current reply content corresponding to the current question according to the current question and the first intervention reply content when the first intervention reply content is available; wherein, the candidate reference question is selected based on the matching degree between the current question and the reference question, and then the intervention reply content is selected based on whether the intervention reply content corresponding to the candidate reference question is available to generate the current reply content, which can ensure that the current reply content is the expected reply content for the current question, thereby improving the dialogue efficiency.
[0109] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, comply with relevant laws and regulations, and do not violate public order and good morals.
[0110] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0111] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0112] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0113] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0114] The computing unit 601 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the intelligent dialogue method. For example, in some embodiments, the intelligent dialogue method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the intelligent dialogue method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the intelligent dialogue method by any other appropriate means (e.g., by means of firmware).
[0115] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0117] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0119] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0120] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0121] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0122] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. An intelligent dialogue method, comprising: Get the current issue in the conversation; querying a first database according to the current question to obtain candidate reference questions in the first database that match the current question, and first intervention response content corresponding to the candidate reference questions; the first database includes various reference questions and intervention response content corresponding to the reference questions; Determining whether the first intervention answer content is available according to the current question, the first intervention answer content, and an availability judgment model; If the first intervention answer content is available, generating a current answer content corresponding to the current question according to the current question and the first intervention answer content; If the candidate reference question is not obtained, or if the available first intervention response content is not obtained, obtaining historical conversation content corresponding to the current question during the conversation; Summarizing the current question and the historical conversation content to obtain current summary content; querying a second database based on the current summary content to obtain candidate reference summary content in the second database that matches the current summary content, and second intervention response content corresponding to the candidate reference summary content; the second database includes each reference summary content and the intervention response content corresponding to the reference summary content; determining whether the second intervention reply content is available according to the current summary content, the second intervention reply content corresponding to the candidate reference summary content, and the availability judgment model; When the second intervention answer content is available, the current answer content corresponding to the current question is generated according to the current summary content and the second intervention answer content.
2. The method according to claim 1, wherein The first database also includes a reference question vector for the reference question; querying the first database according to the current question to obtain candidate reference questions in the first database that match the current question, and first intervention response content corresponding to the candidate reference questions, includes: determining a current problem vector for the current problem; querying the first database according to the current question vector to obtain a reference question vector in the first database that matches the current question vector; Determining the reference question corresponding to the matched reference question vector as the candidate reference question; Obtain first intervention response content corresponding to the candidate reference question in the first database.
3. The method according to claim 2, wherein: The querying the first database according to the current question vector to obtain a reference question vector in the first database that matches the current question vector includes: Determining vector similarities between the current question vector and each reference question vector in the first database; A reference question vector whose corresponding vector similarity is greater than or equal to a first similarity threshold is determined as a reference question vector that matches the current question vector.
4. The method according to claim 1, wherein The determining, based on the current question, the first intervention answer content, and the availability judgment model, whether the first intervention answer content is available includes: Inputting the current question and the first intervention answer content into the usability judgment model, and obtaining a usability judgment result output by the usability judgment model; It is determined whether the first intervention reply content is available according to the availability judgment result.
5. The method according to claim 1, wherein There are multiple first intervention answer contents available; generating a current answer content corresponding to the current question based on the current question and the first intervention answer content, including: Selecting a candidate reference question from a plurality of candidate reference questions according to a matching degree between the candidate reference question corresponding to the available first intervention answer content and the current question; The first intervention answer content corresponding to the selected candidate reference question and the current question are input into the generative large language model to obtain the current answer content output by the generative large language model.
6. The method according to claim 1, wherein The summarizing process of the current question and the historical conversation content to obtain the current summary content includes: Inputting the current question and the historical conversation content into a content summarization model, and obtaining the current summary content output by the content summarization model; The content summarization model is obtained by fine-tuning the generative large language model based on training data; the training data includes sample questions, sample historical conversation content, and sample summary content.
7. The method according to claim 6, wherein: The method for obtaining the training data includes: Obtaining multiple sample questions and sample historical conversation content corresponding to the sample questions; Determining prompt content; the prompt content indicates that summary content generation processing is to be performed; Inputting the sample question, the sample historical conversation content corresponding to the sample question, and the prompt content into a generative large language model, and obtaining a sample summary content output by the generative large language model; The sample questions, the sample historical conversation contents corresponding to the sample questions, and the sample summary contents are combined and processed to obtain the training data.
8. The method according to claim 1, wherein The second database also includes a reference summary content vector of the reference summary content; querying the second database according to the current summary content to obtain candidate reference summary content in the second database that matches the current summary content, and second intervention response content corresponding to the candidate reference summary content, includes: Determining a current summary content vector of the current summary content; querying the second database according to the current summary content vector to obtain a reference summary content vector in the second database that matches the current summary content vector; Determining the reference summary content corresponding to the matched reference summary content vector as the candidate reference summary content; Obtain second intervention response content corresponding to the candidate reference summary content in the second database.
9. An intelligent dialogue device, comprising: The first acquisition module is used to obtain the current question in the conversation process; a second acquisition module, configured to query a first database based on the current question to obtain candidate reference questions in the first database that match the current question, and first intervention response content corresponding to the candidate reference questions; the first database includes various reference questions and intervention response content corresponding to the reference questions; a first determining module, configured to determine whether the first intervention response content is available based on the current question, the first intervention response content, and an availability judgment model; a first generating module, configured to generate, if the first intervention reply content is available, current reply content corresponding to the current question based on the current question and the first intervention reply content; The device further includes a third acquisition module, a summary processing module, a fourth acquisition module, a second determination module, and a second generation module; The third acquisition module is configured to acquire historical conversation content corresponding to the current question during the conversation if the candidate reference question is not acquired, or if the available first intervention response content is not acquired; The summary processing module is used to summarize the current question and the historical conversation content to obtain the current summary content; The fourth acquisition module is configured to query a second database based on the current summary content to obtain candidate reference summary content in the second database that matches the current summary content, and second intervention response content corresponding to the candidate reference summary content; the second database includes each reference summary content and the intervention response content corresponding to the reference summary content; The second determining module is configured to determine whether the second intervention reply content is available based on the current summary content, the second intervention reply content corresponding to the candidate reference summary content, and the availability judgment model; The second generating module is configured to generate current response content corresponding to the current question based on the current summary content and the second intervention response content when the second intervention response content is available.
10. The device according to claim 9, wherein The first database also includes a reference question vector of the reference question; the second acquisition module includes a first determination unit, a first acquisition unit, a second determination unit and a second acquisition unit; The first determining unit is configured to determine a current question vector of the current question; The first acquiring unit is configured to query the first database according to the current question vector to acquire a reference question vector in the first database that matches the current question vector; The second determining unit is configured to determine the reference question corresponding to the matched reference question vector as the candidate reference question; The second acquisition unit is used to obtain the first intervention response content corresponding to the candidate reference question in the first database.
11. The device according to claim 10, wherein The first acquiring unit is specifically configured to: Determining vector similarities between the current question vector and each reference question vector in the first database; A reference question vector whose corresponding vector similarity is greater than or equal to a first similarity threshold is determined as a reference question vector that matches the current question vector.
12. The device according to claim 9, wherein The first determining module is specifically configured to: Inputting the current question and the first intervention answer content into the usability judgment model, and obtaining a usability judgment result output by the usability judgment model; It is determined whether the first intervention reply content is available according to the availability judgment result.
13. The device according to claim 9, wherein There are multiple first intervention reply contents available; the first generation module is specifically configured to: Selecting a candidate reference question from a plurality of candidate reference questions according to a matching degree between the candidate reference question corresponding to the available first intervention answer content and the current question; The first intervention answer content corresponding to the selected candidate reference question and the current question are input into the generative large language model to obtain the current answer content output by the generative large language model.
14. The device according to claim 9, wherein The summary processing module is specifically used to: Inputting the current question and the historical conversation content into a content summarization model, and obtaining the current summary content output by the content summarization model; The content summarization model is obtained by fine-tuning the generative large language model based on the training data; The training data includes sample questions, sample historical conversation content, and sample summary content.
15. The device according to claim 14, wherein The method for obtaining the training data includes: Obtaining multiple sample questions and sample historical conversation content corresponding to the sample questions; Determining prompt content; the prompt content indicates that summary content generation processing is to be performed; Inputting the sample question, the sample historical conversation content corresponding to the sample question, and the prompt content into a generative large language model, and obtaining a sample summary content output by the generative large language model; The sample questions, the sample historical conversation contents corresponding to the sample questions, and the sample summary contents are combined and processed to obtain the training data.
16. The device according to claim 9, wherein The second database also includes the reference summary content vector of the reference summary content; the fourth acquisition module is specifically configured to: Determining a current summary content vector of the current summary content; querying the second database according to the current summary content vector to obtain a reference summary content vector in the second database that matches the current summary content vector; Determining the reference summary content corresponding to the matched reference summary content vector as the candidate reference summary content; Obtain second intervention response content corresponding to the candidate reference summary content in the second database.
17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.
19. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Question and answer processing method and device, electronic equipment and storage medium
CN113553412A
Response statement generation method and device, computer equipment and storage medium
CN114116998A