Response method and device of robot, electronic equipment and storage medium
By using big model recognition and vector database retrieval technology in customer service robots, accurate answers are generated, and the problem that customer service robots cannot provide accurate answers is solved, improving user experience and problem solving efficiency.
Patent Information
- Application Number
- CN202411602860.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-25
AI Technical Summary
Customer service robots cannot provide accurate answers based on user's questions, resulting in user problems that cannot be effectively solved.
By obtaining the currently to be answered questions, using the pre-constructed large model to identify and output the numerical vector, search similar question-and-answer pairs based on the pre-constructed user-customer service robot vector database, calculate the similarity and generate the target answer to answer the questions.
It improves the accuracy and hit rate of answering customer service robot questions, ensures that user problems are effectively solved, and improves user experience and satisfaction.
Smart Images

Figure CN119691105A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing and intelligent customer service systems, and in particular to a robot response method, device, electronic device and storage medium. Background Art
[0002] As the digital transformation of financial technology continues to deepen, the interaction between users and insurance companies is increasingly conducted through online platforms, which requires the customer service system to constantly adapt to these changes. To this end, the insurance industry is gradually shifting its customer service business from traditional manual services to automated customer service robots. By introducing customer service robots, users can communicate with customer service robots in a timely and continuous manner without having to waste time waiting for manual calls. This not only improves the customer service experience, but also increases customer satisfaction. At the same time, customer service robots can store historical questions raised by users and classify and manage them, providing support for the continuous improvement of customer service robots. Therefore, improving the accuracy and hit rate of customer service robot questions is an important part of building an efficient and intelligent customer service system.
[0003] However, despite the many advantages of intelligent customer service robots, there are still some problems. For example, the customer service robots cannot provide accurate answers based on the user's questions, or the answers given are inaccurate, which will lead to the user's problems not being effectively solved, reducing the user experience. At the same time, in this case, manual customer service intervention is often required, which increases the cost of manual customer service and needs to be solved urgently. Summary of the invention
[0004] The present application provides a robot answering method, device, electronic device and storage medium to solve the problem that the customer service robot cannot provide accurate answers based on the user's questions, resulting in the user's questions cannot be effectively solved.
[0005] The first aspect of the present application provides a robot response method, comprising the following steps:
[0006] Get the current questions to be answered;
[0007] Using a pre-built large model to identify the current question to be answered, and outputting a numerical vector corresponding to the current question to be answered, and based on a pre-built user-customer service robot vector database, retrieving all question-answer pair vectors corresponding to the numerical vector to obtain a question-answer pair data set of the numerical vector;
[0008] Calculate the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector, and determine a target question-answer pair vector that meets a preset similarity condition based on the similarity, and generate a target answer based on the target question-answer pair vector to answer the current question to be answered through the target answer.
[0009] According to an embodiment of the present application, determining the target question-answer pair vector that satisfies the preset similarity condition based on the similarity includes:
[0010] Using a preset answer ranking algorithm to score all question-answer pair vectors in the question-answer pair dataset;
[0011] Based on the scoring results, all the question-answer pair vectors are sorted according to the scores from high to low, and the question-answer pair vectors that meet the preset ranking in the sorting results are used as the target question-answer pair vectors.
[0012] According to an embodiment of the present application, after determining the target question-answer pair vector that satisfies the preset similarity condition based on the similarity, the method further includes:
[0013] The target question-answer pair vector is spliced and corrected to obtain the target answer according to the spliced and corrected target question-answer pair vector.
[0014] According to one embodiment of the present application, before obtaining the current question to be answered, the method further includes:
[0015] Get historical question and answer data;
[0016] Preprocess the historical question and answer data, and establish a user-customer service robot question and answer data set based on the preprocessed historical question and answer data;
[0017] The user-customer service robot vector database is generated according to the user-customer service robot question and answer data set.
[0018] According to an embodiment of the present application, the obtaining of historical question and answer data includes:
[0019] Acquire structured data of the user and the customer service robot and unstructured data of the user and the customer service robot, wherein the structured data of the user and the customer service robot include information data of the user, behavior data of the user, information data of the customer service robot and behavior data of the customer service robot, and the unstructured data of the user and the customer service robot include preset product terms and service policies;
[0020] The historical question and answer data is constructed based on the structured data and the unstructured data.
[0021] According to the robot answering method of the embodiment of the present application, the current question to be answered is obtained, and a pre-built large model is used for identification, and the corresponding numerical vector is output. Based on the pre-built user-customer service robot vector database, all question-answer pair vectors corresponding to the numerical vector are retrieved to obtain a question-answer pair data set of the numerical vector, and the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector is calculated, and the target question-answer pair vector that meets the preset similarity condition is determined, and then the generated target answer is used to answer the current question to be answered. In this way, the problem that the customer service robot cannot provide accurate answers based on the user's questions, resulting in the user's problems not being effectively solved, etc. is solved. Through model training, question-answer pair retrieval and generation, the efficiency of retrieval and the flexibility of generation are improved, so that the answers to the user's questions are more accurate.
[0022] A second aspect of the present application provides a robot response device, including:
[0023] The acquisition module is used to obtain the current questions to be answered;
[0024] A retrieval module is used to identify the current question to be answered by using a pre-built large model, and output a numerical vector corresponding to the current question to be answered, and retrieve all question-answer pair vectors corresponding to the numerical vector based on a pre-built user-customer service robot vector database to obtain a question-answer pair data set of the numerical vector;
[0025] The answering module is used to calculate the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector, and determine a target question-answer pair vector that meets a preset similarity condition based on the similarity, and generate a target answer based on the target question-answer pair vector to answer the current question to be answered through the target answer.
[0026] According to one embodiment of the present application, the response module includes:
[0027] A scoring unit, configured to score all question-answer pair vectors in the question-answer pair data set using a preset answer ranking algorithm;
[0028] A sorting unit is used to sort all the question-answer pair vectors according to the scores from high to low based on the scoring results, and use the question-answer pair vectors that meet the preset ranking in the sorting results as the target question-answer pair vectors.
[0029] According to an embodiment of the present application, after determining the target question-answer pair vector that satisfies the preset similarity condition based on the similarity, the response module is further configured to:
[0030] A splicing unit is used to perform splicing correction on the target question-answer pair vector to obtain the target answer according to the spliced and corrected target question-answer pair vector.
[0031] According to an embodiment of the present application, before obtaining the current question to be answered, the obtaining module further includes:
[0032] A first acquisition unit, used to acquire historical question and answer data;
[0033] A data preprocessing unit, used to perform data preprocessing on the historical question and answer data, and establish a user-customer service robot question and answer data set based on the preprocessed historical question and answer data;
[0034] A generating unit is used to generate the user-customer service robot vector database according to the user-customer service robot question and answer data set.
[0035] According to one embodiment of the present application, the acquisition module includes:
[0036] a second acquisition unit, configured to acquire structured data of the user and the customer service robot and unstructured data of the user and the customer service robot, wherein the structured data of the user and the customer service robot include information data of the user, behavior data of the user, information data of the customer service robot and behavior data of the customer service robot, and the unstructured data of the user and the customer service robot include preset product terms and service policies;
[0037] A construction unit is used to construct the historical question and answer data based on the structured data and the unstructured data.
[0038] According to the robot's answering device of the embodiment of the present application, the current question to be answered is obtained, and a pre-built large model is used for identification, and the corresponding numerical vector is output. Based on the pre-built user-customer service robot vector database, all question-answer pair vectors corresponding to the numerical vector are retrieved to obtain a question-answer pair data set of the numerical vector, and the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector is calculated, and the target question-answer pair vector that meets the preset similarity condition is determined, and then the generated target answer is used to answer the current question to be answered. In this way, the problem that the customer service robot cannot provide accurate answers based on the user's questions, resulting in the user's questions not being effectively solved, etc. is solved. Through model training, question-answer pair retrieval and generation, the efficiency of retrieval and the flexibility of generation are improved, so that the answers to the user's questions are more accurate.
[0039] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the robot's response method as described in the above embodiment.
[0040] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the robot's response method as described in the above embodiment.
[0041] A fifth aspect of the present application provides a computer program product, including a computer program, which is executed to implement the robot's response method described in the above embodiment.
[0042] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0044] Figure 1 A flowchart of a robot response method provided according to an embodiment of the present application;
[0045] Figure 2 This is a schematic diagram of the overall process of a question-and-answer session between a user and a customer service robot according to an embodiment of the present application;
[0046] Figure 3 A schematic diagram of fine-tuning a large model according to an embodiment of the present application;
[0047] Figure 4 is a block diagram of an example of a response device of a robot according to an embodiment of the present application;
[0048] Figure 5 A schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0050] The following describes the robot answering method, device, electronic device and storage medium of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that the customer service robot mentioned in the above background technology cannot provide accurate answers based on the user's questions, resulting in the user's questions cannot be effectively solved, the present application provides a robot answering method, in which the current question to be answered is obtained, and a pre-built large model is used for recognition, and the corresponding numerical vector is output. Based on the pre-built user-customer service robot vector database, all question-answer pair vectors corresponding to the numerical vector are retrieved to obtain a question-answer pair data set of the numerical vector, and the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector is calculated, and the target question-answer pair vector that meets the preset similarity condition is determined, and then the generated target answer is used to answer the current question to be answered. In this way, the customer service robot cannot provide accurate answers based on the user's questions, resulting in the user's questions cannot be effectively solved. Through model training, question-answer pair retrieval and generation, the efficiency of retrieval and the flexibility of generation are improved, so that the answers to the user's questions are more accurate.
[0051] Specifically, Figure 1 A flowchart of a robot response method provided in an embodiment of the present application.
[0052] like Figure 1 As shown, the robot's answering method includes the following steps:
[0053] In step S101, the current question to be answered is obtained.
[0054] According to one embodiment of the present application, before obtaining the current question to be answered, it also includes: obtaining historical question and answer data; performing data preprocessing on the historical question and answer data, and establishing a user-customer service robot question and answer data set based on the preprocessed historical question and answer data; and generating a user-customer service robot vector database based on the user-customer service robot question and answer data set.
[0055] According to one embodiment of the present application, obtaining historical question and answer data includes: obtaining structured data of users and customer service robots and unstructured data of users and customer service robots, wherein the structured data of users and customer service robots include user information data, user behavior data, customer service robot information data and customer service robot behavior data, and the unstructured data of users and customer service robots include preset product terms and service policies; constructing historical question and answer data based on structured data and unstructured data.
[0056] Among them, the preset product terms and service policies can be set by technical personnel in this field according to actual question and answer needs, and are not specifically limited here.
[0057] Specifically, in order to improve the accuracy and hit rate of the customer service robot in answering user questions, the embodiment of the present application first needs to construct the knowledge base data of the user-customer service robot, that is, the user-customer service robot question and answer data set, and continuously optimize the user-customer service robot question and answer data set, so that it is possible to search in the user-customer service robot question and answer data set according to the questions raised by the user to obtain the corresponding high-accuracy answers to the questions.
[0058] Specifically, if Figure 2 As shown in the figure, first, the historical question and answer data of the user-customer service robot is obtained, and the historical question and answer data is preprocessed, that is, the historical question and answer data (question and answer pairs) is cleaned, for example, the historical question and answer data is preprocessed by natural language technologies such as word segmentation, stop word removal, and stemming, so as to highlight the key information in the question and answer data, clean up and correct errors, and remove redundancy to improve the efficiency and accuracy of subsequent information retrieval; secondly, a user-customer service robot question and answer data set is established based on the preprocessed historical question and answer data, so as to generate a corresponding user-customer service robot vector database based on the user-customer service robot question and answer data set, mainly It includes question-answer pair cleaning and calling the big model to obtain the corresponding numerical vector of the question-answer pair, that is, calling the big model to obtain the embedding of the question-answer pair query, and storing the question-answer pair containing the embedding in the user-customer service robot vector database; finally, based on the constructed user-customer service robot vector database, after obtaining the user's current question to be answered, a retrieval model can be constructed, such as a method based on an inverted index, or a more efficient retrieval model can be constructed in combination with deep learning technology, so as to use the retrieval model to search in the user-customer service robot vector database to determine the final output answer.
[0059] Among them, historical question and answer data mainly include structured data of users and customer service robots and unstructured data of users and customer service robots. Among them, the structured data of users and customer service robots include user information data (such as user ID (Identification), gender, age, preferences and other basic information), user behavior data (such as user browsing, clicking behavior, browsing time, answer waiting time, etc.), customer service robot information data (such as customer service ID, gender, age, job level, etc.) and customer service robot behavior data (such as customer service service quality, average reply time, praise rate, customer complaint rate, customer service conversation records, etc.). The unstructured data of users and customer service robots include preset product terms and service policies (such as insurance product terms and insurance service policies, etc.).
[0060] It should be noted that since the question and answer data between users and customer service robots are not strictly one-on-one questions and answers, there are a lot of data with relatively poor quality, such as (1) only the user speaks and the customer service robot does not reply; (2) the conversation between the user and the customer service robot is incomplete, with only a small amount of conversation, and the user's problem is not fundamentally solved; (3) it is not strictly one-on-one questions and answers, and there are situations where questions and answers are interspersed or misplaced, that is, the user asks several new questions, and the customer service robot replies slowly and is still replying to the previous question, which will cause the question and reply to be misplaced, thereby causing training bias. Therefore, based on the above-mentioned problems, the embodiment of the present application needs to perform data preprocessing on the historical question and answer data of the user-customer service robot obtained, and filter out the situations where there is no reply from the customer service robot and the conversation is less coherent, so as to improve the effectiveness of subsequent information retrieval.
[0061] Furthermore, if Figure 3 As shown, in the embodiment of the present application, it is necessary to use the historical question and answer data after data preprocessing and use the qwen2-72B-instrut large model for fine-tuning, so as to continuously optimize the user-customer service robot vector database so that information can be updated in a timely manner. At the same time, it can avoid the phenomenon of large model fabrication leading to knowledge illusion, thereby obtaining high-quality question and answer pairs between users and customer service robots.
[0062] It should be noted that in actual applications, models and algorithms can be continuously optimized, and user feedback data can be used to adjust models and optimize parameters to continuously improve the performance and user experience of customer service robots.
[0063] In step S102, the pre-built large model is used to identify the current question to be answered, and the numerical vector corresponding to the current question to be answered is output. Based on the pre-built user-customer service robot vector database, all question-answer pair vectors corresponding to the numerical vector are retrieved to obtain a question-answer pair data set of the numerical vector.
[0064] Specifically, after obtaining the user's current question to be answered, the embodiment of the present application uses a pre-built big model to identify the current question to be answered, and outputs a numerical vector corresponding to the current question to be answered. That is to say, it is necessary to identify the current question to be answered in a format that is adapted to the big model according to the big model, output the numerical vector corresponding to the current question to be answered, and retrieve all question-answer pair vectors corresponding to the numerical vector in the user-customer service robot vector database, thereby combining the two models of information retrieval and generation to achieve retrieval-enhanced generation of question-answer pairs, wherein the retrieval model and the generation model can be selected and adjusted according to the specific application scenario and data conditions.
[0065] In step S103, the similarity between all question-answer pair vectors and the numerical vector in the question-answer pair data set is calculated, and based on the similarity, a target question-answer pair vector that meets the preset similarity condition is determined, and a target answer is generated based on the target question-answer pair vector to answer the current question to be answered through the target answer.
[0066] According to one embodiment of the present application, a target question-answer pair vector that meets a preset similarity condition is determined based on similarity, including: scoring all question-answer pair vectors in a question-answer pair data set using a preset answer sorting algorithm; based on the scoring results, sorting all question-answer pair vectors according to scores from high to low, and taking the question-answer pair vector that meets the preset ranking in the sorting results as the target question-answer pair vector.
[0067] According to one embodiment of the present application, after determining the target question-answer pair vector that meets the preset similarity condition based on the similarity, it also includes: splicing and correcting the target question-answer pair vector to obtain the target answer based on the spliced and corrected target question-answer pair vector.
[0068] Among them, the preset similarity conditions, the preset answer sorting algorithm and the preset ranking can all be selected by technical personnel in this field according to actual question and answer needs, and are not specifically limited here.
[0069] Specifically, after obtaining a question-answer pair data set of numerical vectors, the similarities between all question-answer pair vectors in the question-answer pair data set and the numerical vectors are calculated respectively, and a target question-answer pair vector that meets a preset similarity condition is determined based on the similarity.
[0070] Specifically, the embodiment of the present application can adopt a preset answer sorting algorithm, such as an efficient retrieval generation algorithm, and use machine learning technology to score all question-answer pair vectors in the question-answer pair data set; secondly, based on the scoring results, all question-answer pair vectors are sorted according to the scores from high to low, and the question-answer pair vectors that meet the preset ranking in the sorting results are used as the target question-answer pair vectors, that is, the retrieval model is used to retrieve several candidate answers with the highest similarity to the current question to be answered, for example, the top 3 question-answer pair vectors in the sorting results are used as the target question-answer pair vectors; finally, the target question-answer pair vectors are spliced and corrected using the generation model, that is, the target question-answer pair vectors are polished, so as to obtain the target answer according to the spliced and corrected target question-answer pair vectors, so as to answer the current question to be answered through the target answer, that is, by polishing, enriching, and integrating several target question-answer pair vectors with high similarity to the numerical vector, the target question-answer pair vector can accurately express the target answer that the user wants, and is easy to understand, so that the spliced and corrected optimal answer is sent to the user, so as to improve the user's user experience and improve the accuracy and credibility of the answer.
[0071] For example, "Task Description": You are an intelligent customer service expert, and I need you to extract answers related to "user questions" from "question and answer pairs" and polish them to ensure smooth sentences and clear logic; "User question": This is the user's current question to be answered, for example, asking about the terms and conditions of auto insurance; "Question and answer pair": This is the target answer generated after retrieval and splicing based on the current question to be answered, for example, after retrieval, the target answer is generated by splicing the vectors of several target question and answer pairs with the highest similarity to the terms and conditions of auto insurance.
[0072] Therefore, based on the specific discussion of the above embodiments, the present application can achieve the following beneficial effects:
[0073] (1) Combination of retrieval enhancement and generation: The embodiment of the present application combines the two models of information retrieval and generation, and realizes the retrieval and generation of more accurate and rich answers to questions raised by users. In this way, the high efficiency of retrieval and the flexibility of generation are combined, the comprehensiveness of solving user problems is improved, and the hit rate and accuracy of customer service robot questions and answers are improved, which can better meet user needs and improve user satisfaction.
[0074] (2) Deep learning application for generative model training: Deep learning technologies, such as recurrent neural networks and Transformers, are used to train generative models and achieve intelligent generation of user questions. This method can better understand user questions and generate more accurate and reasonable answers.
[0075] (3) Design of retrieval enhancement generation algorithm: An efficient retrieval enhancement generation algorithm was designed, which uses machine learning technology to score and rank candidate answers and select the best answer to return to the user. This algorithm improves the accuracy and credibility of the answers.
[0076] (4) Customized design and optimization: Customized design and optimization can be carried out according to specific application scenarios and requirements, with good versatility and scalability. This method can be applied to different fields and different types of customer service robots, improving their applicability and practicality.
[0077] According to the robot answering method of the embodiment of the present application, the current question to be answered is obtained, and a pre-built large model is used for identification, and the corresponding numerical vector is output. Based on the pre-built user-customer service robot vector database, all question-answer pair vectors corresponding to the numerical vector are retrieved to obtain a question-answer pair data set of the numerical vector, and the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector is calculated, and the target question-answer pair vector that meets the preset similarity condition is determined, and then the generated target answer is used to answer the current question to be answered. In this way, the problem that the customer service robot cannot provide accurate answers based on the user's questions, resulting in the user's problems not being effectively solved, etc. is solved. Through model training, question-answer pair retrieval and generation, the efficiency of retrieval and the flexibility of generation are improved, so that the answers to the user's questions are more accurate.
[0078] Next, the robot response device according to the embodiment of the present application is described with reference to the accompanying drawings.
[0079] Figure 4 It is a block diagram of a response device of a robot according to an embodiment of the present application.
[0080] like Figure 4 As shown, the robot's response device 10 includes: an acquisition module 100 , a retrieval module 200 and a response module 300 .
[0081] The acquisition module 100 is used to obtain the current question to be answered;
[0082] The retrieval module 200 is used to identify the current question to be answered by using the pre-built large model, and output the numerical vector corresponding to the current question to be answered, and retrieve all question-answer pair vectors corresponding to the numerical vector based on the pre-built user-customer service robot vector database to obtain a question-answer pair dataset of the numerical vector;
[0083] The answering module 300 is used to calculate the similarity between all question-answer pair vectors and the numerical vector in the question-answer pair data set, and determine the target question-answer pair vector that meets the preset similarity condition based on the similarity, and generate the target answer based on the target question-answer pair vector to answer the current question to be answered through the target answer.
[0084] According to one embodiment of the present application, the response module 300 includes:
[0085] A scoring unit, used to score all question-answer pair vectors in the question-answer pair dataset using a preset answer ranking algorithm;
[0086] The sorting unit is used to sort all question-answer pair vectors according to the scores from high to low based on the scoring results, and take the question-answer pair vectors that meet the preset ranking in the sorting results as the target question-answer pair vectors.
[0087] According to an embodiment of the present application, after determining the target question-answer pair vector that meets the preset similarity condition based on the similarity, the answering module 300 is further configured to:
[0088] The splicing unit is used to perform splicing correction on the target question-answer pair vector to obtain the target answer according to the spliced and corrected target question-answer pair vector.
[0089] According to an embodiment of the present application, before obtaining the current question to be answered, the obtaining module 100 further includes:
[0090] A first acquisition unit, used to acquire historical question and answer data;
[0091] A data preprocessing unit, used to preprocess the historical question and answer data, and establish a user-customer service robot question and answer data set based on the preprocessed historical question and answer data;
[0092] A generating unit is used to generate a user-customer service robot vector database according to a user-customer service robot question and answer data set.
[0093] According to one embodiment of the present application, the acquisition module 100 includes:
[0094] A second acquisition unit is used to acquire structured data of the user and the customer service robot and unstructured data of the user and the customer service robot, wherein the structured data of the user and the customer service robot includes information data of the user, behavior data of the user, information data of the customer service robot and behavior data of the customer service robot, and the unstructured data of the user and the customer service robot includes preset product terms and service policies;
[0095] A building block for constructing historical question-answering data based on structured and unstructured data.
[0096] According to the robot's answering device of the embodiment of the present application, the current question to be answered is obtained, and a pre-built large model is used for identification, and the corresponding numerical vector is output. Based on the pre-built user-customer service robot vector database, all question-answer pair vectors corresponding to the numerical vector are retrieved to obtain a question-answer pair data set of the numerical vector, and the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector is calculated, and the target question-answer pair vector that meets the preset similarity condition is determined, and then the generated target answer is used to answer the current question to be answered. In this way, the problem that the customer service robot cannot provide accurate answers based on the user's questions, resulting in the user's questions not being effectively solved, etc. is solved. Through model training, question-answer pair retrieval and generation, the efficiency of retrieval and the flexibility of generation are improved, so that the answers to the user's questions are more accurate.
[0097] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0098] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0099] When the processor 502 executes the program, the robot response method provided in the above embodiment is implemented.
[0100] Furthermore, the electronic device further comprises:
[0101] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0102] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0103] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0104] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0105] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0106] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0107] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the robot's response method as described above is implemented.
[0108] This embodiment also provides a computer program product, including a computer program, which is executed to implement the robot response method of the above embodiment.
[0109] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0110] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0111] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0112] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0113] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0114] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0115] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0116] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A robot response method, characterized in that: The following steps are involved: Get the current questions to be answered; Using a pre-built large model to identify the current question to be answered, and outputting a numerical vector corresponding to the current question to be answered, and based on a pre-built user-customer service robot vector database, retrieving all question-answer pair vectors corresponding to the numerical vector to obtain a question-answer pair data set of the numerical vector; Calculate the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector, and determine a target question-answer pair vector that meets a preset similarity condition based on the similarity, and generate a target answer based on the target question-answer pair vector to answer the current question to be answered through the target answer.
2. The method according to claim 1, characterized in that The determining, based on the similarity, a target question-answer pair vector that satisfies the preset similarity condition comprises: Using a preset answer ranking algorithm to score all question-answer pair vectors in the question-answer pair dataset; Based on the scoring results, all the question-answer pair vectors are sorted according to the scores from high to low, and the question-answer pair vectors that meet the preset ranking in the sorting results are used as the target question-answer pair vectors.
3. The method according to claim 1 or 2, characterized in that: After determining the target question-answer pair vector that meets the preset similarity condition based on the similarity, the method further includes: The target question-answer pair vector is spliced and corrected to obtain the target answer according to the spliced and corrected target question-answer pair vector.
4. The method according to claim 1, characterized in that Before obtaining the current question to be answered, the method further includes: Get historical question and answer data; Preprocess the historical question and answer data, and establish a user-customer service robot question and answer data set based on the preprocessed historical question and answer data; The user-customer service robot vector database is generated according to the user-customer service robot question and answer data set.
5. The method according to claim 4, characterized in that The obtaining of historical question and answer data includes: Acquire structured data of the user and the customer service robot and unstructured data of the user and the customer service robot, wherein the structured data of the user and the customer service robot include information data of the user, behavior data of the user, information data of the customer service robot and behavior data of the customer service robot, and the unstructured data of the user and the customer service robot include preset product terms and service policies; The historical question and answer data is constructed based on the structured data and the unstructured data.
6. A robot response device, characterized in that: include: The acquisition module is used to obtain the current questions to be answered; A retrieval module is used to identify the current question to be answered by using a pre-built large model, and output a numerical vector corresponding to the current question to be answered, and retrieve all question-answer pair vectors corresponding to the numerical vector based on a pre-built user-customer service robot vector database to obtain a question-answer pair data set of the numerical vector; The answering module is used to calculate the similarity between all question-answer pair vectors in the question-answer pair data set and the numerical vector, and determine a target question-answer pair vector that meets a preset similarity condition based on the similarity, and generate a target answer based on the target question-answer pair vector to answer the current question to be answered through the target answer.
7. The device according to claim 6, characterized in that The response module comprises: A scoring unit, configured to score all question-answer pair vectors in the question-answer pair data set using a preset answer ranking algorithm; A sorting unit is used to sort all the question-answer pair vectors according to the scores from high to low based on the scoring results, and use the question-answer pair vectors that meet the preset ranking in the sorting results as the target question-answer pair vectors.
8. The device according to claim 6 or 7, characterized in that After determining the target question-answer pair vector that meets the preset similarity condition based on the similarity, the answering module is further configured to: A splicing unit is used to perform splicing correction on the target question-answer pair vector to obtain the target answer according to the spliced and corrected target question-answer pair vector.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the robot response method according to any one of claims 1 to 5.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the robot response method as described in any one of claims 1 to 5.
Citation Information
Cited By
Bank intelligent customer service question answering method and system based on large model
CN120994786A