Intelligent dialogue method and device and electronic equipment
By querying the database, the matching candidate reference questions and their intervention response content is obtained, and the usability judgment model is used to determine its availability, which solves the problem that the answer reply content in smart customer service does not match the current question, and improves the dialogue efficiency.
Patent Information
- Application Number
- CN202411605385.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-11
AI Technical Summary
During the conversation between smart customer service and the object, when there are specific keywords in a specific historical question in the current question, the answer reply content may not match the expected answer of the current question, resulting in inefficiency of the conversation.
By obtaining the current problem during the conversation, the first database is queryed to obtain the matching candidate reference questions and their intervention response content, and the usability judgment model is used to determine the availability of the intervention response content. When the intervention response content is available, generate the answer reply content for the current question.
Improve the matching degree between the current question and the answer reply content, ensure that the answer reply content meets the expectations of the current question, thereby improving conversation efficiency.
Smart Images

Figure CN119597873A_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, in the conversation process 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 specific keywords in specific historical questions exist in the current question, the semantics of the current question and the semantics of the specific historical question may be greatly different, resulting in the reply content not being the expected reply content of 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, the method comprising: obtaining a current question in a dialogue process; querying a first database according to the current question to obtain a candidate reference question in the first database that matches the current question, and a first intervention reply content corresponding to the candidate reference question; the first database includes various reference questions and intervention reply contents corresponding to the reference questions; determining whether the first intervention reply content is available according to the current question, the first intervention reply content and an availability judgment model; and if the first intervention reply content is available, generating a current reply content corresponding to the current question according to the current question and the first intervention reply content.
[0006] According to another aspect of the present disclosure, an intelligent dialogue device is provided, the device comprising: a first acquisition module, used to acquire a current question in a dialogue process; a second acquisition module, used to query a first database according to the current question, and acquire a candidate reference question in the first database that matches the current question, and a first intervention reply content corresponding to the candidate reference question; the first database includes various reference questions and intervention reply contents corresponding to the reference questions; a first determination module, used to determine whether the first intervention reply content is available according to the current question, the first intervention reply content and an availability judgment model; a first generation module, used to generate a current reply content corresponding to the current question according to 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 so that the at least one processor can 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, and when the computer program is executed by a processor, the steps of the intelligent dialogue method proposed above in the present disclosure are implemented.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[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 4It 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 of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art 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, in the conversation process 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 specific keywords in specific historical questions exist in the current question, the semantics of the current question and the semantics of the specific historical question may be greatly different, resulting in the reply content not being the expected reply content of the current question and poor dialogue efficiency.
[0021] In view of 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 dialogue method of the embodiment of the present disclosure can be applied to an intelligent dialogue device, which can be configured in an electronic device so that the electronic device can perform an intelligent dialogue function. The following embodiments are described by taking the execution subject as 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 an electronic device as an example for description.
[0025] like Figure 1 As shown, the intelligent dialogue method may include the following steps:
[0026] Step 101, obtaining the current question in the conversation process.
[0027] In the disclosed embodiment, the conversation process may be a conversation process between the object and the 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 according to the current question, obtain the candidate reference questions in the first database that match the current question, and the first intervention response content corresponding to the candidate reference questions; the first database includes various reference questions and the 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, for each reference question in the first database, the similarity between the reference question and the current question; 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 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 reply 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 by combining the keywords in the reference question and the 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 disclosed embodiment, the first database may be determined by the electronic device, or may 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 may be, for example, determining the intervention party; providing an interactive interface to the intervention party to provide the historical conversation record to the intervention party through the interactive interface, and receiving the intervention information returned by the intervention party. The intervention information may include historical questions in the historical conversation record and the intervention reply content corresponding to the historical questions. The electronic device may determine the first database in combination with multiple intervention information.
[0033] It should be noted that the conversation process between the electronic device and the object can be triggered based on advertisements, links, etc. The content displayed by the advertisements or links, etc. is the relevant content of the intervening party. Correspondingly, the conversation process between the electronic device and the object involves the relevant content of the intervening party. Therefore, the intervening party can be the party to which the content displayed by the advertisements or links, etc., which trigger the conversation process belongs.
[0034] Step 103: Determine whether the first intervention reply content is available according to the current question, the first intervention reply content and the availability judgment model.
[0035] In the disclosed embodiment, 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 an availability judgment model, obtain an 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 judgment result may be a specific numerical value. Different numerical values are used to represent different availability judgment results. For example, when the availability judgment result is a first numerical value, it indicates that the first intervention reply content is available; when the availability judgment result is a second numerical value, it indicates that the first intervention reply content is unavailable.
[0037] Among them, the first intervention reply content is available, which may mean that the match between the current question and the first intervention reply content is high, and the first intervention reply content can be used as the current reply content corresponding to the current question. The first intervention reply content is unavailable, which may mean that the match between the current question and the first intervention reply content is low, 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 the training data, wherein the training data may include sample questions, sample intervention answer content, and whether it is available.
[0039] In which, the availability judgment model and the current question are combined to determine whether the first intervention reply content is available. Based on the large number of parameters in the availability judgment model and the high judgment accuracy, the matching degree between the first intervention reply content and the current question can be further accurately determined, thereby further improving the matching degree between the determined current reply content and the current question, and further improving the dialogue efficiency.
[0040] Step 104, 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.
[0041] In an embodiment of the present disclosure, when the number of available first intervention reply contents is single, the process for the electronic device to execute step 104 may, for example, be to input the current question and the first intervention reply content into a 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 questions corresponding to the available first intervention reply contents 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 match 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 sort the candidate reference questions corresponding to the available multiple first intervention reply contents in descending order based on the matching degree to obtain a sorting result; and determine the candidate reference question ranked first in the sorting result as the selected candidate reference question.
[0045] Among them, by combining the matching degree between the candidate reference questions corresponding to the available first intervention reply content and the current question, selecting a candidate reference question from multiple candidate reference questions, and then determining the current reply content, can further improve the matching degree between the determined current reply content and the current question. In addition, combining the generative large language model, the current question, and the first intervention reply content to generate the current reply content can ensure the style consistency between the current question and the current reply content, thereby further improving the dialogue efficiency.
[0046] In the embodiments of the present disclosure, it is also necessary to explain that, when no available first intervention reply content is obtained, the electronic device can generate current reply content corresponding to the current question in combination with the current question; or, the electronic device can generate current reply content corresponding to the current question in combination with the current question and historical conversation content.
[0047] The intelligent dialogue method of the disclosed embodiment 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.
[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 by combining 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, obtaining the current question in the conversation process.
[0050] Step 202, determining a current question vector of a current question.
[0051] In the embodiments 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 according to the current question vector to obtain a reference question vector in the first database that matches the current question vector; the first database includes each reference question, a reference question vector of the reference question, and intervention answer content corresponding to the reference question.
[0053] Among them, the reference question vector of the reference question 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 the reference question vectors 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 front in the sorting result as reference question vectors that match the current question vector.
[0057] In addition, the electronic device can also combine an approximate nearest neighbor search algorithm (ANN) to determine a reference question vector in the first database that matches the current question vector. The approximate nearest neighbor search algorithm, for example, a local sensitive hashing algorithm, a vector quantization algorithm, a graph embedding method, etc., can 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 reply content is available based on the current question, the first intervention reply 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 the 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 contents; 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 vectors 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 contents 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 a reference question vector corresponding to the vector similarity ranked first in the sorting result; obtain a candidate reference question corresponding to the reference question vector; and generate a current reply content corresponding to the current question by combining the first intervention reply content corresponding to the candidate reference question and 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 to 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 problem in the dialogue process; determines the current problem vector of the current problem; queries the first database according to the current problem vector to obtain the reference problem vector matching the current problem vector in the first database; the first database includes various reference problems, reference problem vectors of the reference problems, and intervention reply contents corresponding to the reference problems; determines the reference problem corresponding to the matching reference problem vector as a candidate reference problem; obtains the first intervention reply contents corresponding to the candidate reference problem in the first database; determines whether the first intervention reply contents are available according to the current problem, the first intervention reply contents, and the availability judgment model; and generates the current reply contents corresponding to the current problem according to the current problem and the first intervention reply contents when the first intervention reply contents are available; wherein, the candidate reference problem is selected in combination with the vector similarity between the current problem vector of the current problem and the reference problem vector of the reference problem, and then the intervention reply contents are selected to generate the current reply contents, which can further ensure the matching degree between the candidate reference problem and the current problem, thereby improving the accuracy of the current reply contents and further improving the dialogue efficiency.
[0066] In order to further improve the matching degree between the current answer content and the current question, when 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, obtaining the current question in the conversation process.
[0068] Step 302, query the first database according to the current question, obtain the candidate reference questions in the first database that match the current question, and the first intervention response content corresponding to the candidate reference questions; the first database includes various reference questions and the intervention response content corresponding to the reference questions.
[0069] Step 303: Determine whether the first intervention reply content is available according to the current question, the first intervention reply content and the availability judgment model.
[0070] Step 304, 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.
[0071] Step 305, when no candidate reference question is obtained, or when no available first intervention reply content is obtained, historical dialogue content corresponding to the current question in the dialogue 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 before 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 may include two parts, namely, 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 may 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; the 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 acquiring training data may include: acquiring multiple sample questions, and sample historical conversation content corresponding to the sample questions; determining prompt content; the prompt content instructs summary content generation processing; 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 acquire 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 contents can be, for example, collecting historical questions and corresponding historical conversation contents from various industries; performing conversation cleaning processing on the collected data, for example, ambiguous conversation filtering, low-quality conversation filtering, etc., and determining the filtered historical questions as sample historical questions; and determining the historical conversation contents corresponding to the sample historical questions as sample historical conversation contents.
[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 the training data with an accuracy greater than or equal to the accuracy threshold is obtained.
[0082] Step 307, query the second database according to the current summary content, obtain the candidate reference summary content in the second database that matches the current summary content, 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.
[0083] In an embodiment of the present disclosure, in one example, the process of the electronic device executing step 307 may be, for example, 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 also include a reference summary content vector of the reference summary content. Correspondingly, the process of the electronic device executing step 307 may be, for example, determining the 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 matching the current summary content vector in the second database; determining the reference summary content corresponding to the matching reference summary content vector as the candidate reference summary content; and obtaining the second intervention reply 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 disclosed embodiment, the second database may be determined by the electronic device, or may 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 may be, for example, determining the intervention party; providing an interactive interface to the intervention party to provide the historical conversation record to the intervention party through the interactive interface, and receiving the intervention information returned by the intervention party. The intervention information may include historical questions, historical conversation content, and intervention reply content in the historical conversation record. The electronic device may determine the second database in combination with multiple intervention information.
[0087] It should be noted that the conversation process between the electronic device and the object can be triggered based on advertisements, links, etc. The content displayed by the advertisements or links, etc. is the relevant content of the intervening party. Correspondingly, the conversation process between the electronic device and the object involves the relevant content of the intervening party. Therefore, the intervening party can be the party to which the content displayed by the advertisements or links, etc., which trigger the conversation process belongs.
[0088] In the embodiments of the present disclosure, it is also necessary to explain 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 according to the current summary content, the second intervention reply content corresponding to the candidate reference summary content, and the availability judgment model.
[0090] In the disclosed embodiment, 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 according to the availability judgment result.
[0091] Step 309, 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.
[0092] In the disclosed embodiment, when the available second intervention reply content is single, the electronic device can directly input the current summary content and the second intervention reply content into the generative large language model to obtain the current reply content output by the generative large language model. When the available second intervention reply content is multiple, the electronic device can select one second intervention reply content from the multiple second intervention reply contents; input the selected second intervention reply content and the current summary content into the generative large language model to obtain the current reply content 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 herein.
[0095] The intelligent dialogue method of the disclosed embodiment 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; 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; obtains the historical dialogue content corresponding to the current question in the dialogue process when the candidate reference question is not obtained or when the available first intervention reply content is not obtained; 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 invention relates to a method for generating a query string comprising: a query string that contains candidate reference summary contents that match the current summary contents in the query string, and second intervention reply contents corresponding to the candidate reference summary contents; a second database that includes various reference summary contents and intervention reply contents corresponding to the reference summary contents; determining whether the second intervention reply contents are available according to the current summary contents, the second intervention reply contents corresponding to the candidate reference summary contents, and an availability judgment model; when the second intervention reply contents are available, generating the current reply contents corresponding to the current question according to the current summary contents and the second intervention reply contents; wherein, in the case that the candidate reference question is not obtained in the first database, the current question and the corresponding historical conversation contents can be summarized; based on the processed current summary contents, the second database is queried to obtain matching candidate reference summary contents, and then the current reply contents are determined, which can further ensure the matching degree between the current reply contents and the current question, thereby improving the conversation efficiency.
[0096] The following examples are used 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 according to the current summary content vector to obtain the 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 process of determining the second database offline includes the following steps. Step 408, merchant feedback dialogue (historical issues, historical dialogue content corresponding to historical issues, intervention response content). Step 409, scenario summary (i.e., determining reference summary content in combination with historical issues and corresponding historical dialogue content). Step 410, representation extraction (i.e., determining a reference summary content vector of the reference summary content for matching with the current summary content vector to obtain candidate reference summary content).
[0098] In order to implement the above embodiments, the present disclosure also provides an intelligent dialogue device. Figure 5 As shown, Figure 5 The fourth embodiment of the present disclosure is shown in FIG. 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 problem in the dialogue process; the second acquisition module 502 is used to query the first database according to the current problem, and obtain the candidate reference question matching the current problem 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; the first determination module 503 is used to determine whether the first intervention reply content is available according to the current problem, 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 problem according to the current problem 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 the 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 matching 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 the 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 a first similarity threshold as the reference question vector that matches the current question vector.
[0102] As a possible implementation method of the embodiment of the present disclosure, the first determination module 503 is specifically used 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 according to the availability judgment result.
[0103] As a possible implementation method of the 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 questions corresponding to the available first intervention reply contents 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 the 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 dialogue content corresponding to the current question in the dialogue 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 dialogue content to obtain the current summary content; the fourth acquisition module is used to query the second database according to the current summary content to obtain the candidate reference summary content matching the current summary content in the second 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; the second determination module is used to determine whether the second intervention reply content is available according to 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 according to 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, 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 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 indicates summary content generation processing; 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 the 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 disclosed embodiment 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 solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, and comply with the 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 an embodiment 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 processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required 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. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. 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] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0114] The computing unit 601 may be a variety of general and / or special 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 running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, 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 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the intelligent dialogue method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the intelligent dialogue method in any other appropriate manner (e.g., by means of firmware).
[0115] Various implementations of the systems and techniques described above 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), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including 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 may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 may 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 may 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 with 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 may 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 the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0121] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0122] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An intelligent dialogue method, the method comprising: Get the current issue in the conversation; According to the current question, query the first database to obtain candidate reference questions matching the current question in the first database, and first intervention answer content corresponding to the candidate reference questions; the first database includes various reference questions and intervention answer 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; When the first intervention reply content is available, a current reply content corresponding to the current question is generated according to the current question and the first intervention reply content.
2. The method according to claim 1, wherein: The first database also includes a reference question vector of the reference question; the querying the first database according to the current question to obtain a candidate reference question in the first database that matches the current question, and a first intervention answer content corresponding to the candidate reference question, includes: determining a current problem vector for the current problem; Query 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; Determine 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: Determine the vector similarity 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, according to 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 current answer contents corresponding to the current question according to the current question and the first intervention answer contents, including: Selecting a candidate reference question from a plurality of the 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 a 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 method further comprises: In the case where the candidate reference question is not obtained, or in the case where the available first intervention answer content is not obtained, obtaining the historical dialogue content corresponding to the current question in the dialogue process; Summarizing the current question and the historical conversation content to obtain current summary content; querying a 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 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; 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 reply content is available, the current reply content corresponding to the current question is generated according to the current summary content and the second intervention reply content.
7. The method according to claim 6, 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.
8. The method according to claim 7, wherein: The method for obtaining the training data includes: Obtaining multiple sample questions and sample historical conversation contents corresponding to the sample questions; Determine prompt content; the prompt content indicates to perform summary content generation processing; 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 the sample summary content output by the generative large language model; The sample question, the sample historical conversation content corresponding to the sample question, and the sample summary content are combined and processed to obtain the training data.
9. The method according to claim 6, wherein: The second database also includes a reference summary content vector of the reference summary content; the 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 reply 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.
10. An intelligent dialogue device, comprising: The first acquisition module is used to acquire the current question in the conversation process; A second acquisition module is used to query a first database according to the current question, and obtain candidate reference questions in the first database that match the current question, and first intervention answer content corresponding to the candidate reference questions; the first database includes various reference questions and intervention answer content corresponding to the reference questions; A first determination module, configured to determine whether the first intervention response content is available according to the current question, the first intervention response content, and an availability judgment model; The first generating module is used to generate 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.
11. The device according to claim 10, 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 used to determine a current problem vector of the current problem; The first acquisition unit is used 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.
12. The device according to claim 11, wherein 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; 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.
13. The device according to claim 10, wherein: The first determination 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.
14. The device according to claim 10, wherein: The number of available first intervention reply contents is multiple; the first generation module is specifically used to: Selecting a candidate reference question from a plurality of the 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 a generative large language model to obtain the current answer content output by the generative large language model.
15. The device according to claim 10, wherein: 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 acquire the historical dialogue content corresponding to the current question in the dialogue process when the candidate reference question is not acquired or when the available first intervention reply 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 used to query the second database according to the current summary content, and obtain the candidate reference summary content in the second database that matches the current summary content, 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; The second determination module is used to determine 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; The second generating module is used to generate the current reply content corresponding to the current question according to the current summary content and the second intervention reply content when the second intervention reply content is available.
16. The device according to claim 15, wherein: The summary processing module is specifically used for: 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.
17. The device according to claim 16, wherein: The method for obtaining the training data includes: Obtaining multiple sample questions and sample historical conversation contents corresponding to the sample questions; Determine prompt content; the prompt content indicates to perform summary content generation processing; 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 the sample summary content output by the generative large language model; The sample question, the sample historical conversation content corresponding to the sample question, and the sample summary content are combined and processed to obtain the training data.
18. The device according to claim 15, wherein: The second database also includes the reference summary content vector of the reference summary content; the fourth acquisition module is specifically used 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.
19. 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 9.
20. 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 9.
21. 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 9.
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
Intelligent dialogue method and device
CN116204621A
Conversation processing method and device and electronic equipment
CN117421402A
Usability evaluating device
JP2001051876A
Cited By
Information processing device, method, and program
JP7897377B1