Talk skill recommendation method and related equipment
By converting the customer's questions to be replied to into semantic vectors and querying the semantic vector library and knowledge vector library, the problem of difficult to accurately recommend dialogue content matching customer needs in the existing technology is solved, and efficient speech recommendations that match customer needs are achieved.
Patent Information
- Application Number
- CN202411658729.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-28
AI Technical Summary
It is difficult to accurately recommend conversational content that matches customer needs in the prior art.
By converting the questions that the customer wants to reply during the conversation into semantic vectors and querying similar vectors from the semantic vector library and the knowledge vector library, obtaining preset speech content or generating new speech content.
Ensure that the recommended words can match the customer needs expressed in the semantics of the questions to be replied to by the customer, and improve communication efficiency and customer experience.
Smart Images

Figure CN119719271A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a speech recommendation method, device, electronic device, computer-readable storage medium and computer program product. Background Art
[0002] Talk recommendation is a technology that automatically recommends conversation content or strategies suitable for specific scenarios and customer needs through algorithm models based on customer data and behavior analysis. It is widely used in customer service, online sales, technical support and other fields to improve communication efficiency and enhance customer experience. Through the talk recommendation system, companies can provide real-time conversation suggestions for customer service personnel or provide personalized customer interaction solutions for self-service platforms.
[0003] Currently, in the field of conversation recommendation technology, how to accurately recommend conversation content that matches customer needs is an urgent problem to be solved. Summary of the invention
[0004] The embodiment of the present application provides a method for recommending conversational skills, so as to solve the problem existing in the prior art of how to accurately recommend conversational content that matches customer needs.
[0005] Embodiments of the present application also provide a speech recommendation device, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] The present application embodiment adopts the following technical solutions: A method for recommending a speech technique, the method comprising: Converting the question to be answered input by the customer during the conversation into a target semantic vector representing the semantics of the question to be answered; If a semantic vector whose similarity with the target semantic vector meets the first similarity condition is queried from the semantic vector library, a preset first speech content for responding to the semantics represented by the queried semantic vector is obtained for recommendation; the semantic vector library stores various semantic vectors; the various semantic vectors are respectively used to represent the semantics of different questions to be answered that the customer is expected to input during the conversation; If the target semantic vector is not found, querying from a knowledge vector library whether there is a target knowledge vector whose similarity with the target semantic vector meets a second similarity condition; the knowledge vector library stores various knowledge vectors; and the various knowledge vectors are respectively used to represent different knowledge contents involved in the business scenario to which the dialogue process belongs; If the target knowledge vector exists, determining whether there is knowledge content associated with the target knowledge vector in the knowledge base; If the associated knowledge content exists in the knowledge base, then based on the input question to be answered and the associated knowledge content, a pre-trained large language model is prompted to generate a second speech content for responding to the input question to be answered for recommendation; the knowledge base stores knowledge content associated with the knowledge vector in the knowledge vector library.
[0007] A speech technique recommendation device, comprising: A vector conversion unit, used to convert the question to be answered input by the customer during the conversation into a target semantic vector representing the semantics of the input question to be answered; The first recommendation unit is used to obtain a preset first speech content for responding to the semantics represented by the queried semantic vector if a semantic vector whose similarity with the target semantic vector meets a first similarity condition is queried from the semantic vector library; the semantic vector library stores various semantic vectors; the various semantic vectors are respectively used to represent the semantics of different questions to be answered that the customer is expected to input during the conversation; A query unit, configured to query from a knowledge vector library whether there is a target knowledge vector whose similarity with the target semantic vector meets a second similarity condition if the first recommendation unit fails to query the target semantic vector; the knowledge vector library stores various knowledge vectors; and the various knowledge vectors are respectively used to represent different knowledge contents involved in the business scenario to which the dialogue process belongs; a judgment unit, configured to judge whether there is knowledge content associated with the target knowledge vector in the knowledge base if the target knowledge vector exists; The second recommendation unit is used to prompt a pre-trained large language model to generate a second speech content for responding to the input question to be answered and recommend it based on the input question to be answered and the associated knowledge content if the associated knowledge content exists in the knowledge base; the knowledge base stores knowledge content associated with the knowledge vector in the knowledge vector library.
[0008] An electronic device, comprising: a memory and a processor, wherein: The memory is used to store programs; the processor is coupled to the memory and is used to execute the programs stored in the memory to execute the above-mentioned speech recommendation method.
[0009] A computer-readable storage medium storing a computer program, wherein the computer program can implement the above-mentioned speech recommendation method when executed by a computer.
[0010] A computer program product, characterized in that the computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the above-mentioned speech recommendation method. At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: Since the recommended speech content is a preset first speech content corresponding to a semantic vector with similar semantics to the "semantics of the question to be answered input by the customer", or the speech content is generated based on the knowledge content associated with the input question to be answered and a knowledge vector similar to the target semantic vector, it can be ensured that the recommended speech content can match the customer needs expressed by the semantics of the question to be answered input by the customer. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A specific implementation flow chart of a method for recommending speech techniques provided in an embodiment of the present application; Figure 2 A schematic diagram of a specific process when the speech recommendation method provided in the embodiment of the present application is applied in practice; Figure 3 A schematic diagram of the specific structure of a speech recommendation device provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0013] Those skilled in the art may appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0014] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0015] Example 1 In order to solve the problem existing in the prior art of how to accurately recommend conversation content that matches customer needs, an embodiment of the present application provides a method for recommending conversation skills.
[0016] The execution subject of the method may be any computing device, or may be software running on the computing device. The embodiment of the present application does not limit the computing device or software that the execution subject is.
[0017] In addition, different steps of the method may be implemented by different computing devices or software, and the embodiments of the present application do not limit which computing device or software is used to implement which step.
[0018] For ease of description, the method provided in the embodiment of the present application is described in detail below by taking an example in which the executor of the method is a client used by an agent to communicate with a customer through conversation.
[0019] Please refer to the instruction manual Figure 1 A specific implementation flow chart of a method for recommending a speech technique provided in an embodiment of the present application includes the following steps: Step 11: Convert the question to be answered input by the customer during the conversation into a target semantic vector representing the semantics of the question to be answered; In an optional implementation, the client may call the BGE model to vectorize the question to be answered, and obtain a semantic vector (target semantic vector) representing the semantics of the question to be answered.
[0020] The BGE model, full name BAAI General Embedding, is an open source Chinese and English semantic vector model released by the Beijing Zhiyuan Artificial Intelligence Research Institute. The model performs well in multiple important indicators, especially in semantic retrieval capabilities, which is far ahead of other models. In the embodiment of the present application, the model can be set in the client, and after the client obtains the question to be answered, it can call the model to execute: vectorize the question to be answered, and obtain the target semantic vector that represents the semantics of the question to be answered.
[0021] Specifically, the client can input the question to be answered (a sentence consisting of a word sequence) into the BGE model. After receiving the question to be answered, the BGE model uses a bidirectional long short-term memory network (BiLSTM) to encode the input word sequence in the encoding stage to obtain the context information of each word. In the decoding stage, the attention mechanism is used to perform weighted summation on the context information output by the Encoder stage to obtain a vector representation of the sentence, thereby realizing the vectorization of the question to be answered into a semantic vector.
[0022] In an optional implementation, the client may actively obtain the content of the real-time conversation between the agent and the customer, and once the latest text input by the customer is obtained, the latest text is used as the question to be answered and step 11 is executed.
[0023] In an optional implementation, the client may obtain the text entered by the customer selected by the agent from the real-time conversation as the question to be answered.
[0024] Step 12: If a semantic vector whose similarity with the target semantic vector meets the first similarity condition is found in the semantic vector library, a preset first speech content for responding to the semantics represented by the found semantic vector is obtained and recommended; The semantic vector library stores various semantic vectors; each semantic vector is used to represent the semantics of different questions to be answered that the customer may input during the conversation.
[0025] In an optional implementation, historical high-quality questions can be obtained and processed through Chinese word segmentation and stop word removal to form new questions; each question is converted into a semantic vector representing the semantics of the question, and the converted semantic vector is stored in a vector database - the vector database is the semantic vector library.
[0026] Among them, high-quality questions can come from text-based conversations between agents and customers based on the client, or from conversations between agents and customers using voice calls (including landline calls, mobile phone calls, intercom calls, and voice chats on the Internet, etc.) or video calls. If it comes from a conversation using a voice call or video call, the voice data generated in the conversation can be converted into text data and then into semantic vectors.
[0027] In an optional implementation, the similarity between the target semantic vector and the target semantic vector meets the first similarity condition, which means that the similarity value between the target semantic vector and the target semantic vector is greater than the first similarity threshold; or, the similarity value between the target semantic vector and the target semantic vector falls within a preset first similarity value interval. The first similarity threshold and the first similarity value interval can be set according to actual needs.
[0028] In an optional implementation, the similarity value may refer to a cosine similarity value.
[0029] In an optional implementation, based on the pre-established correspondence between different semantic vectors and corresponding speech content, the speech content (first speech content) corresponding to the "semantic vector whose similarity to the target semantic vector meets the first similarity condition" can be obtained for recommendation. The corresponding speech content may include historical high-quality speech content for responding to historical high-quality questions.
[0030] Step 13: If the target semantic vector is not found, query the knowledge vector library to see whether there is a target knowledge vector whose similarity with the target semantic vector meets the second similarity condition; The knowledge vector library stores various knowledge vectors; each knowledge vector is used to represent different knowledge contents involved in the business scenario to which the dialogue process belongs.
[0031] In an optional implementation, the business scenario may include: insurance sales scenario; the knowledge content represented by each knowledge vector includes: the content of insurance contract clauses. For example, the insurance clauses may be converted into vectors (knowledge vectors) and then stored in the knowledge vector library.
[0032] In an optional implementation, the similarity between the target semantic vector and the target semantic vector meets the second similarity condition, which means that the similarity value between the target semantic vector and the target semantic vector is greater than the second similarity threshold; or, the similarity value between the target semantic vector and the target semantic vector falls within a preset second similarity value interval. The first similarity threshold and the second similarity value interval can be set according to actual needs.
[0033] Step 14: If the target knowledge vector exists, determine whether there is knowledge content associated with the target knowledge vector in the knowledge base; The knowledge base stores knowledge contents associated with the knowledge vectors in the knowledge vector library.
[0034] In a specific example, "the knowledge content associated with the target knowledge vector" refers to the contextual knowledge content of the knowledge content represented by the target knowledge vector. The "knowledge content represented by the target knowledge vector" and its "contextual knowledge content" satisfy: they can together form a coherent sentence that conforms to the natural language expression habits. For example, the "knowledge content represented by the target knowledge vector" is "the coverage of the external power grid failure loss insurance", and its "contextual knowledge content" is the insurance clause in the insurance contract "13. Additional special terms for value-added services for new energy vehicles Additional external power grid failure loss insurance (NEV21111201) New energy vehicles insured with new energy vehicle loss insurance can be insured with this additional insurance. (i) During the insurance period, if the insured new energy vehicle insured with this additional insurance suffers direct losses due to external power grid failure during the charging period, and it does not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract..."
[0035] "The coverage of the external power grid failure loss insurance" and the contextual knowledge content can be practiced into a coherent sentence that conforms to the habits of natural language expression, such as: 13. Additional New Energy Vehicle Value-added Service Special Terms Additional External Power Grid Failure Loss Insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this additional insurance. The coverage of the external power grid failure loss insurance: (i) During the insurance period, if the insured new energy vehicle insured with this additional insurance suffers direct losses due to external power grid failure during the charging period, and it does not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract...
[0036] Step 15: If there is knowledge content associated with the target knowledge vector in the knowledge base, based on the questions to be answered entered by the customer during the conversation and the associated knowledge content, the pre-trained large language model is prompted to generate a second speech content recommendation for responding to the questions to be answered entered by the customer during the conversation.
[0037] In an optional implementation, prompt words can be generated according to a prompt word template based on the questions to be answered and the associated knowledge content input by the customer during the conversation, and then the prompt words can be used to prompt a pre-trained large language model to generate the second speech content.
[0038] For example, following the previous example, assume that the knowledge content associated with the target knowledge vector (which can be called the target knowledge content) is "13. Additional New Energy Vehicle Value-added Service Special Terms Additional External Grid Failure Loss Insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this additional insurance. (i) During the insurance period, if the insured new energy vehicle that has been insured with this additional insurance suffers direct losses during the charging period due to external grid failure, and the losses do not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract...", and the prompt word template is "You are an insurance sales agent, and you know <>. Now the customer has said <>, please reply", Then, according to the target knowledge content and the prompt word template, a new prompt word can be generated: "You are an insurance sales agent. It is known that <13. Additional special terms for value-added services for new energy vehicles Additional external power grid failure loss insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this additional insurance. (i) During the insurance period, if the insured new energy vehicle that has been insured with this additional insurance suffers direct losses due to external power grid failure during the charging period, and the loss does not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract...". Now the customer has said <What is the coverage scope of this external power grid failure loss insurance>, please reply".
[0039] Based on the new prompt word, the pre-trained large language model may generate the second script content, for example, "External grid failure loss insurance is designed specifically for new energy vehicles. When the vehicle is damaged due to grid failure during charging, it does not fall within the scope of liability exemption. We will compensate according to the insurance policy, up to the maximum amount of the main insurance. For example, if the charging pile is damaged due to grid problems, we will be responsible for repairs or compensation, and the specific amount will be determined based on the actual loss." In an optional implementation, the pre-trained large language model may be obtained by performing supervised fine-tuning training on the pre-trained large language model based on a specific data training set; The specific data training set consists of selected questions to be answered; The selected question to be answered is marked with a label, and the label is the selected speech content for responding to the selected user question.
[0040] Among them, the above-mentioned selected questions to be answered can be, for example, high-quality questions in the past; and the selected speech content used to respond to the selected user questions can be historical high-quality speech content used to respond to high-quality questions in the past.
[0041] In an optional implementation, if there are several knowledge contents associated with the target knowledge vector in the knowledge base, the semantic relevance between the question to be answered and the several associated knowledge contents may be determined respectively; According to the semantic relevance, select the knowledge content that meets the preset semantic relevance requirement (for example, the knowledge content ranked first in semantic relevance) from a number of related knowledge contents; Based on the question to be answered and the selected knowledge content, a pre-trained large language model is prompted to generate a recommendation for the second speech content to be used to answer the question.
[0042] In this way, it is possible to select knowledge content that is semantically relevant to the question to be answered and discard knowledge content that is relatively less semantically relevant, so as to avoid the problem that prompting a pre-trained large language model based on knowledge content with relatively less relevance may be misleading and result in inaccurate generated speech content.
[0043] In an optional implementation, the method provided in the embodiment of the present application may further include: If there is no relevant knowledge content in the knowledge base, based on the question to be answered, a pre-trained large language model is prompted to generate a third speech content for recommendation to the question to be answered.
[0044] In an optional implementation, a prompt word can be generated based on the prompt word template based on the question to be answered, and then the prompt word can be used to prompt the pre-trained large language model to generate the third speech content for the question to be answered. For example, the question to be answered is "Oh, how much is the total amount?", and the prompt word template is "You are an insurance sales agent, and now the customer has said <>, please reply", then the prompt word "You are an insurance sales agent, and now the customer has said <Oh, how much is the total amount" can be generated and input into the pre-trained large model. The large model may generate the speech content according to the context of the current conversation, such as "Including 350 yuan of driving insurance, the total is 3536 yuan."
[0045] By adopting the above method provided in the embodiment of the present application, since the recommended speech content is based on the preset first speech content corresponding to the semantic vector with similar semantics to the "semantics of the question to be answered input by the customer", or is speech content generated based on the knowledge content associated with the input question to be answered and the knowledge vector similar to the target semantic vector, it can be ensured that the recommended speech content can match the customer needs expressed by the semantics of the question to be answered input by the customer.
[0046] Example 2 The following introduces a specific application example of the above method provided in an embodiment of the present application in an actual scenario.
[0047] In actual applications, taking the insurance business as an example, scenarios that require real-time sales recommendations include insurance sales scenarios, specifically telephone sales scenarios, sales scenarios based on WeChat enterprise accounts, and so on.
[0048] Taking the telephone sales scenario as an example, during the telephone sales process, the conversations between the agent and the customer are relatively frequent. If the speech recommendation based on approximate semantic recognition in the related technology is adopted, or if the speech recommendation based on the large model is used alone, it is difficult to meet the accuracy and real-time requirements for the speech content of the speech recommendation. In order to meet these requirements, in Example 2 of the present application, the speech recommendation method introduced in Example 1 of the present application will be used to perform speech recommendation in the reimbursement sales scenario.
[0049] In Example 2 of the present application, the speech recommendation method used in the actual scenario can be called a speech recommendation method based on a three-level recommendation strategy. The method can be composed of three-level recommendation strategies, namely: The first-level recommendation strategy is based on approximate semantic matching; the second-level recommendation strategy is based on the insurance clause knowledge vector library; the third-level recommendation strategy is based on the fine-tuning large model. The first-level recommendation strategy is based on the semantic vector library and preset speech content. It aims to utilize the mature speech content of the head office and branches of the insurance company and provide it to the agents in a semantically similar way. In this way, on the one hand, it can support the efficient application of customized speech to speech recommendation and ensure the real-time requirements of speech recommendation; on the other hand, based on the mature speech content, it can provide a certain degree of support for the stability and accuracy of the final recommended speech content.
[0050] To ensure the smooth implementation of the first-level recommendation strategy, high-quality questions and high-quality speech content used to deal with high-quality questions (which can also be understood as high-quality answers / responses to high-quality questions) can be obtained from the head office and branches of the insurance company; after routine data cleaning of these questions and speech content, each question is converted into a semantic vector that represents the semantics of the question, and the converted semantic vector is stored in a vector database - the vector database can be called a semantic vector library; then, a correspondence between the semantic vectors in the vector database and the corresponding speech content is established.
[0051] For example, assuming that a high-quality question is "It's too expensive, I don't want to buy it anymore", and the high-quality speech content used to deal with this high-quality question is "You get what you pay for, and the price, value-added and after-sales service we can provide are definitely the best", then in Example 2 of this application, "It's too expensive, I don't want to buy it anymore" can be converted into a semantic vector representing the semantics of the text and stored in the vector database; then, a corresponding relationship between the semantic vector and the high-quality speech content can be established. Among them, the high-quality speech content can be stored in the vector database or in other databases.
[0052] In an optional implementation, a specific construction process of the vector database is as follows: 1. Data preprocessing and cleaning: The high-quality questions of the head office and branches of the insurance company are processed by Chinese word segmentation and stop word removal to form new questions; Among them, high-quality questions can come from text-based conversations between agents and customers based on instant messaging clients, or from conversations between agents and customers using voice calls (including landline calls, mobile phone calls, intercom calls, and voice chats on the Internet, etc.) or video calls. If the conversations come from voice calls or video calls, the voice data generated in the conversation can be converted into text data and then pre-processed and cleaned.
[0053] 2. Use the BGE model to vectorize all new questions and obtain vector representations (semantic vectors) of all new questions; The semantics represented by these vector representations are equivalent to the "semantics of different questions to be answered that the customer is expected to input during the conversation" described in Example 1 of the present application.
[0054] 3. According to the number of vector elements contained in each semantic vector, respectively set length indicators for representing the number; store the semantic vector in a vector database (such as a Faiss vector database).
[0055] When storing the semantic vector in the vector database, multiple semantic vectors may be combined to obtain combined data before storage. For example, when combining, the following may be combined in sequence: a length indicator set for semantic vector 1, semantic vector 1, a separator, a length indicator set for semantic vector 2, semantic vector 2, a separator, a length indicator set for semantic vector 3, semantic vector 3, a separator, etc., so that a single semantic vector may be located and obtained from the combined data later according to the length indicator and the separator.
[0056] Based on this vector database, we can subsequently retrieve semantic vectors that are semantically similar to the questions asked by customers in real-time conversations with the agents, and use them as target semantic vectors. Furthermore, based on the pre-established correspondence between each semantic vector and high-quality speech content, we can obtain high-quality speech content corresponding to the target semantic vector and recommend it to the agents.
[0057] The second-level recommendation strategy is based on the knowledge vector library, which aims to make full use of the knowledge content involved in the business scenario - such as the insurance clauses involved in the insurance sales scenario - to solve the problem of slow response speed caused by cumbersome operations faced by agents in searching for knowledge content (such as insurance clauses), so as to ensure that the recommended speech can meet the real-time performance requirements as much as possible.
[0058] To ensure the smooth implementation of the second-level recommendation strategy, insurance clauses and other knowledge content can be converted into vectors (knowledge vectors) and stored in the knowledge vector library (insurance clause knowledge vector library). Based on the knowledge vector library, for customer questions that do not match similar semantic vectors in the semantic vector library, the relevant knowledge vectors in the knowledge vector library can be further queried based on the semantic vectors corresponding to the customer questions, and then the large model can be called to generate the content of the speech based on the queried knowledge vectors.
[0059] In an optional implementation, a specific construction process of the insurance clause knowledge vector library is as follows: 1. Obtain the insurance policy documents from the insurance company; The obtained insurance clause file may be in a text file format, or in a spreadsheet format, an electronic document format, an image file format, an audio file format, a video file format, a compressed file format, a web page file format, a PDF file format, or a database file format.
[0060] The obtained insurance clause file records the text content of the insurance clause.
[0061] 2. Convert unstructured and semi-structured insurance clause documents into structured documents; For example, the PaddleOCR component can be used to identify the text content of insurance clauses from unstructured files such as image file formats or PDF file formats, and generate structured files based on the text content, such as generating an insurance clause file in a text file format containing the text content.
[0062] Text segmentation and chunking: For the text in the structured file obtained in 1 above or converted in 2 above, the text is segmented at the location of the punctuation marks as the segmentation position to obtain each paragraph of text in the unit of sentence; the text segment set consisting of the obtained each paragraph of text can be further chunked. Specifically, the chunking mentioned here refers to dividing several text segments that meet the specified conditions into the same group; wherein the specified conditions include: they can together form a coherent sentence that conforms to the expression habits of natural language.
[0063] The BGE model is used to vectorize each text segment in each group to obtain the corresponding knowledge vectors. Specifically, the text segment can be input into the BGE model. After receiving the text segment (sentence), the BGE model uses a bidirectional long short-term memory network (BiLSTM) to encode the input word sequence in the encoding stage to obtain the context information of each word in the text segment. In the decoding stage, the attention mechanism is used to perform weighted summation on the context information output by the encoder stage to obtain the vector representation of the sentence, thereby realizing the vectorization of the text segment into a knowledge vector.
[0064] According to the number of vector elements contained in each knowledge vector, the length indicators used to characterize the quantity are set respectively; the knowledge vector is stored in the insurance clause knowledge vector library (for example, it can be the Faiss vector database). The third-level recommendation strategy is a strategy based on fine-tuning the large model. It aims to accurately recommend the content of the speech that meets the current dialogue scenario through the context of the real-time conversation between the agent and the customer and the fine-tuning large model, and provide a backup for the overall speech recommendation process. Specifically, according to the third-level recommendation strategy, the speech content will be generated by optimizing the prompt words and adjusting the parameters, using the large model that has been fine-tuned based on high-quality speech.
[0065] For the fine-tuned large model used in the three-level recommendation strategy, in an optional implementation, the specific training process is as follows: Data acquisition: obtain high-quality questions from the head office and branches of the insurance company and high-quality scripts used to respond to the high-quality questions; the obtained high-quality questions and high-quality scripts can both be data in text format, that is, text data.
[0066] 2. Data segmentation: The sample data set consisting of the obtained high-quality questions and high-quality speech content is divided into a training set and a test set; In the embodiment of the present application, there is a correspondence between high-quality questions and high-quality speech content - for example, there is a correspondence between high-quality question 1 and high-quality speech content 1 used to respond to the high-quality question 1 - so that high-quality question 1 can be used as sample data, and high-quality speech content 1 is marked as the label of high-quality question 1. All high-quality questions marked with labels together constitute the sample data set of the target task (speech content generation task).
[0067] 3. Model training: The model trained in the embodiment of the present application may be a pre-trained Qwen model. Qwen model is a series of large language models (LLM, also referred to as large models) developed by Alibaba. It was first open sourced in August 2023, with parameter sizes ranging from 1.8 billion to 72 billion. The Qwen model includes the basic model Qwen and the dialogue model Qwen-Chat, which is trained through SFT (supervised fine-tuning) and RLHF (human alignment technology) and has multiple capabilities, such as chatting, creation, summarization, information extraction, translation, code generation, and mathematical reasoning.
[0068] The Qwen model is based on the Transformer architecture and is pre-trained using the standard method of autoregressive language modeling. The implementation method of the pre-training of the Qwen model can refer to the relevant technical implementation, and the embodiments of this application will not be repeated here.
[0069] In an embodiment of the present application, when fine-tuning the pre-trained Qwen model, DeepSpeedZeRO can be used to partition the parameters and states of the large model (Qwen model) to be trained and store them on multiple GPUs, thereby achieving data parallelism, pipeline parallelism, and tensor slicing model parallelism to ensure model training efficiency.
[0070] DeepSpeed is an open source deep learning optimization library developed by Microsoft based on PyTorch (a popular open source machine learning library developed by Facebook). Its purpose is to lower the threshold for large model training, improve the training efficiency of large models, and help developers more efficiently manage and optimize the training and deployment tasks of large models. In addition, DeepSpeed also provides many large model-related tools, such as distributed training management, memory optimization, and model compression, to help developers better manage and optimize large-scale deep learning training tasks.
[0071] ZeRO is an innovative technology for optimizing memory usage. It significantly reduces the memory usage of each GPU by distributing model parameters, optimizer states, and gradients across multiple GPUs. This technology is particularly suitable for training large-scale models because it allows larger models to be trained on a single node without expensive hardware upgrades. In this way, the model training process can be accelerated while reducing the demand for computing resources.
[0072] In an embodiment of the present application, when fine-tuning the pre-trained Qwen model, a supervised fine-tuning method can be used, that is, the target task (the task of generating speech content) is fine-tuned using labeled data. Specifically, the LoRA (Low-Rank Adaptation of LLMs) technology, that is, the low-rank adaptation of LLMs, can be used to achieve efficient fine-tuning of the model parameters. The essence of LoRA is to use fewer training parameters to approximate the incremental parameters obtained by fine-tuning the full parameters of the trained large model, thereby achieving efficient fine-tuning using less video memory. In an embodiment of the present application, the LoRA technology is used to fine-tune the pre-trained Qwen model, and only part of the model parameters can be fine-tuned, thereby further reducing the number of training parameters and video memory usage.
[0073] Based on DeepSpeed and LoRA fine-tuning technology, it is possible to reduce resource consumption while maintaining or improving model performance.
[0074] In the embodiments of the present application, the training set of the target task can be used to fine-tune the pre-trained Qwen model; then, the test set of the target task can be used to evaluate the fine-tuned model to obtain the performance indicators of the model on the target task, and the fine-tuned model whose performance indicators meet the preset performance requirements is selected and deployed in the network node used for speech content generation and recommendation (such as speech recommendation server).
[0075] In the embodiment of the present application, the specific implementation process of fine-tuning the model using the training set is as follows: First, combine the prompt word with the high-quality customer question. For example, the initial prompt word is "You are an insurance sales agent. Now the customer said <> sentence. Please reply." The high-quality question is "It's too expensive. I won't buy it anymore." Then the combination of the two is: "You are an insurance sales agent. Now the customer said <It's too expensive. I won't buy it anymore>. Please reply." The combined prompt words are input into the large model to be fine-tuned to generate corresponding speech content (predicted speech content) and fine-tune the large model.
[0076] Subsequently, the performance of the fine-tuned large model can be evaluated in the following ways: 1. Design a series of test cases (can be designed based on the high-quality questions in the test set); 2. Use the fine-tuned large model to make response predictions for these test cases; 3. Evaluate the accuracy and applicability of the model by comparing the model-predicted words with the high-quality words corresponding to high-quality questions (high-quality words in the test set); 4. Based on the evaluation results, further adjust the model parameters or training strategy to optimize the model performance.
[0077] By performing the above-mentioned fine-tuning on the pre-trained big model, a big model (a trained big model) can be obtained for generating speech content to respond to customer questions based on customer questions.
[0078] In Example 2 of the present application, the execution subject of the speech recommendation method based on the three-level recommendation strategy can be a speech recommendation server or a client, which is used to recommend speech content to the agent. Taking the speech recommendation server as the execution subject as an example, the specific implementation flow diagram of the method is as follows: Figure 2 As shown, it mainly includes the following steps: Step 21: The speech recommendation server calls the BGE model to vectorize the customer questions in the real-time conversation between the agent and the customer, and obtains a semantic vector (target semantic vector) that represents the semantics of the customer question. In an optional implementation, the agent and the customer can respectively use their respective instant messaging clients to conduct a real-time conversation, and the speech recommendation server can be the instant messaging server itself corresponding to the instant messaging client, thereby directly obtaining the customer's problem in the real-time conversation between the agent and the customer; or, although the speech recommendation server is not an instant messaging server, it can establish a connection with the instant messaging server, thereby obtaining the customer's problem in the real-time conversation from the instant messaging server.
[0079] The customer question mentioned here is equivalent to the question to be answered in Example 1 of this application. It can be a text content expressing a question, such as "Is my situation suitable for buying this type of insurance?", or a text content expressing other attitudes, such as "It's too expensive, I'll think about it again."
[0080] In a narrow sense, during the conversation between the customer and the agent, the latest text entered by the customer can be used as a customer question; in a broad sense, during the conversation between the customer and the agent, any text entered by the customer can be used as a customer question.
[0081] In an optional implementation, when an agent needs to obtain recommended speech content, the agent can send a speech content recommendation request to the speech recommendation server through the client corresponding to the speech recommendation server used by the agent; after receiving the request, the server responds to the request and executes step 21.
[0082] In an optional implementation, the request may include a user question selected by the agent. Thus, when executing step 21, the speech recommendation server may call the BGE model to vectorize the customer question and obtain a semantic vector representing the semantics of the customer question.
[0083] In another optional implementation, the speech recommendation server may actively obtain the conversation content of the real-time conversation, and once the customer input, such as the latest text, is obtained, the latest text is used as the user question to execute step 21.
[0084] The BGE model described in step 21, the full name of which is BAAI General Embedding, is an open source Chinese and English semantic vector model released by the Beijing Zhiyuan Artificial Intelligence Research Institute. The model performs well in multiple important indicators, especially in semantic retrieval capabilities, which are significantly ahead of other models. In an embodiment of the present application, the model can be set in a speech recommendation server. After obtaining the customer's question, the server can call the model to execute: vectorize the customer's question to obtain a semantic vector that represents the semantics of the customer's question.
[0085] Specifically, the speech recommendation server can input customer questions (sentences consisting of word sequences) into the BGE model. After receiving the customer questions, the BGE model uses a bidirectional long short-term memory network (BiLSTM) to encode the input word sequence in the encoding stage to obtain the context information of each word. In the decoding stage, the attention mechanism is used to perform weighted summation on the context information output by the encoder stage to obtain the vector representation of the sentence, thereby realizing the vectorization of customer questions into semantic vectors.
[0086] Step 22: Match the target semantic vector with the semantic vectors in the semantic vector library to determine whether there is a semantic vector in the semantic vector library whose cosine similarity value with the target semantic vector is greater than a preset first similarity threshold; if so, execute step 23; if not, execute step 24; Among them, the calculation formula of cosine similarity value is: cosine similarity value = cos(θ). θ is the angle between two vectors. The specific calculation method is to multiply the corresponding elements of the two vectors and then divide them by the product of the modulus lengths of the two vectors. The mathematical expression is: cos(θ) = (A·B) / (||A|| * ||B||).
[0087] A and B represent the target semantic vector and the semantic vector in the library, respectively. A·B represents the dot product of vectors A and B. ||A|| and ||B|| represent the modulus of vectors A and B, respectively. In this way, the similarity between two semantic vectors can be quantified.
[0088] In a specific example, assuming that the user question is "It's too expensive, I don't want to buy it", the target semantic vector representing the semantics of "It's too expensive, I don't want to buy it" is obtained after vectorization of the user question. Then, in step 22, the cosine similarity values between the target semantic vector and each semantic vector in the semantic vector library can be calculated one by one, and the calculated cosine similarity value and the preset first similarity threshold are compared; once the cosine similarity greater than the preset first similarity threshold appears, the subsequent step 23 is executed. For example, assuming that the cosine similarity value between a semantic vector representing the semantics of "expensive" determined from the semantic vector library and the target semantic vector is greater than the preset first similarity threshold, then the subsequent step 23 can be executed.
[0089] For another example, assuming that the user question is “What is the coverage of this external power grid failure loss insurance?”, after vectorizing the user question, we obtain the target semantic vector that represents the semantics of “What is the coverage of this external power grid failure loss insurance?”
[0090] Step 23: Based on the pre-established correspondence between different semantic vectors and corresponding high-quality speech content, obtain the high-quality speech content corresponding to the "semantic vector whose cosine similarity value with the target semantic vector is greater than a preset first similarity threshold" for recommendation; As mentioned above, high-quality speech content is speech content used to respond to high-quality questions. By performing step 23 to recommend high-quality speech content to the agent, high-quality reference speech content can be provided to the agent to assist the agent in efficiently completing the response to the user's question.
[0091] In an optional implementation, the speech recommendation server may send the acquired high-quality speech content to the instant messaging client used by the agent for reference by the agent, so as to implement speech content recommendation.
[0092] In an optional implementation, the agent may be a robot agent, so that the speech recommendation server may directly push the acquired high-quality speech content to the conversation interface of the real-time conversation currently being conducted between the agent and the customer, so as to implement speech content recommendation.
[0093] Continuing with the previous example, assuming that the cosine similarity value between a semantic vector representing the semantic meaning of "expensive" determined from the semantic vector library and the target semantic vector is greater than the preset first similarity threshold, then, based on the semantic vector, we can obtain the high-quality speech content corresponding to the semantic vector "You get what you pay for. The price, value-added and after-sales service we can provide are definitely the best." as the speech content to be recommended, and then recommend the speech content.
[0094] Step 24: Match the target semantic vector with the knowledge vector in the insurance clause knowledge vector library to determine whether there is a knowledge vector (target knowledge vector) in the insurance clause knowledge vector library whose cosine similarity value with the target semantic vector is greater than a preset second similarity threshold; if so, execute step 25; if not, execute step 28; The second similarity threshold may be set to be the same as or different from the first similarity threshold.
[0095] Step 25: According to the target knowledge vector, obtain the knowledge content associated with the target knowledge vector from the knowledge base to obtain a knowledge content set; The knowledge content set refers to a set of acquired knowledge contents associated with the target knowledge vector.
[0096] The knowledge base is a pre-built database for storing knowledge content, and the stored knowledge content at least includes knowledge content related to insurance sales scenarios, such as the terms of insurance contracts.
[0097] It is understood by those skilled in the art that if the solution provided by the embodiment of the present application is applied to other business scenarios, knowledge content related to other business scenarios can be stored in the knowledge base in advance. For example, if the method is applied to the business scenario of "disease consultation", knowledge content related to the disease can be stored in the knowledge base in advance.
[0098] In a specific example, "the knowledge content associated with the target knowledge vector" refers to the contextual knowledge content of the knowledge content represented by the target knowledge vector. The "knowledge content represented by the target knowledge vector" and its "contextual knowledge content" satisfy: they can together form a coherent sentence that conforms to the natural language expression habits. For example, the "knowledge content represented by the target knowledge vector" is "the coverage of the external power grid failure loss insurance", and its "contextual knowledge content" is the insurance clause in the insurance contract "13. Additional special terms for value-added services for new energy vehicles Additional external power grid failure loss insurance (NEV21111201) New energy vehicles insured with new energy vehicle loss insurance can be insured with this additional insurance. (i) During the insurance period, if the insured new energy vehicle insured with this additional insurance suffers direct losses due to external power grid failure during the charging period, and it does not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract..."
[0099] In an optional embodiment, if several text segments that meet specified conditions have been divided into the same group in advance, then based on the text segment corresponding to the target knowledge vector, other text segments in the same group can be obtained from the group to which the text segment belongs as the knowledge content associated with the target knowledge vector.
[0100] In another optional implementation, similar to establishing a correspondence between the semantic vectors in the vector database and the corresponding speech content, a correspondence between the knowledge vectors in the knowledge vector library and the knowledge content (context knowledge content) associated with them can also be established. Based on this correspondence, the speech recommendation server can obtain the knowledge content associated with the target knowledge vector from the knowledge library.
[0101] Since there may be multiple pieces of knowledge content associated with the target knowledge vector (such as multiple insurance clauses), a knowledge content set may be obtained after executing step 25. The knowledge content set often includes multiple pieces of knowledge content.
[0102] Step 26: The speech recommendation server selects the knowledge content that is most semantically relevant to the customer's question from the knowledge content set as the target knowledge content according to the semantic relevance between the customer's question and each piece of knowledge content in the acquired knowledge content set; In an optional implementation, the speech recommendation server may call Reranker to implement step 26. Reranker is a trained machine learning model used to more accurately evaluate the semantic relevance between query text (such as user questions) and specific documents (such as knowledge content).
[0103] In the embodiment of the present application, Reranker can be used to rank the knowledge contents in the knowledge content set according to the user question and the relevance to each piece of knowledge content in the knowledge content set. The higher the relevance, the higher the ranking; the lower the relevance, the lower the ranking. After Reranker completes the ranking of the knowledge contents, the speech recommendation server can, for example, obtain the knowledge content ranked first as the target knowledge content.
[0104] Step 27: The speech recommendation server generates prompt words based on the acquired target knowledge content, and calls the fine-tuned large model to execute: using the generated prompt words as prompts of the large model, the speech content is generated for recommendation.
[0105] The specific recommendation process of the content of the speech can be found in the previous description and will not be repeated here.
[0106] In an optional implementation, prompt words can be generated based on prompt word templates. For example, following the previous example, assuming that the target knowledge content is "13. Additional New Energy Vehicle Value-Added Service Special Terms and Conditions Additional External Grid Failure Loss Insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this additional insurance. (i) During the insurance period, if the insured new energy vehicle that has been insured with this additional insurance suffers direct losses during the charging period due to external power grid failure, and the losses do not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract...", and the prompt word template is "You are an insurance sales agent, and you know <>. Now the customer has said <>, please reply", then, according to the target knowledge content The content and prompt word template can generate new prompt words "You are an insurance sales agent. It is known that <13. Additional special terms for value-added services for new energy vehicles Additional external power grid failure loss insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this additional insurance. (a) During the insurance period, if the insured new energy vehicle that has been insured with this additional insurance suffers direct losses due to external power grid failure during the charging period, and the loss does not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract...". Now the customer has said <What is the coverage scope of this external power grid failure loss insurance>, please reply".
[0107] Based on the new prompt word, the fine-tuned large model generates the content of the speech: "The external power grid failure loss insurance is designed specifically for new energy vehicles. When the vehicle is damaged due to power grid failure during charging, it does not fall within the scope of liability exemption. We will compensate according to the insurance policy, and the maximum amount will not exceed the main insurance amount. For example, if the charging pile is damaged due to power grid problems, we will be responsible for repairs or compensation, and the specific amount will be determined according to the actual loss." Step 28: The speech recommendation server calls the fine-tuned big model to execute: using the customer's question as a prompt for the big model, it generates speech content for recommendation based on the context of the current conversation.
[0108] The specific recommendation process of the content of the speech can be found in the previous description and will not be repeated here.
[0109] In an optional implementation, prompt words can be generated based on prompt word templates. For example, if the customer's question is "Oh, how much is the total amount?" and the prompt word template is "You are an insurance sales agent, and now the customer has said <>, please reply", then the prompt words "You are an insurance sales agent, and now the customer has said <Oh, how much is the total amount?" can be generated and input into the fine-tuned big model. The big model generates the content of the speech "Including 350 yuan of driving insurance, the total amount is 3536 yuan" according to the context of the current conversation.
[0110] 2. Based on the customer's question "What is the coverage of this external power grid failure loss insurance?", the BGE model is first used to vectorize the text "What is the coverage of this external power grid failure loss insurance?" to obtain the vector representation of "What is the coverage of this external power grid failure loss insurance?"; then the vector representation has no similar vector in the approximate question semantic vector library; then the vector representation calculates the approximate vector of the insurance clause vector library through vector cosine similarity, and opens context-related retrieval to extract the context of the vector at the same time to obtain the corresponding text "13. Additional new energy vehicle value-added service special terms and conditions Additional external power grid failure loss insurance" Network failure loss insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this supplementary insurance. (i) During the insurance period, if the insured new energy vehicle that has been insured with this supplementary insurance suffers direct losses due to external power grid failure during the charging period, and it does not fall within the scope of exemption of the insurer's liability, the insurer shall be responsible for compensation in accordance with the provisions of this insurance contract..."; Next, the customer's question and the retrieved clause knowledge are matched and calculated using reranker. If the result is a match, it is retained, if the result is a mismatch, it is discarded; finally, assuming that the proposed The prompt text is "You are an insurance sales agent, and you know <>. Now the customer has said <>, please reply". After combining the retrieved clause knowledge, customer questions and prompt words, we get a new prompt word "You are an insurance sales agent, and you know <13. Additional special terms for value-added services for new energy vehicles Additional external power grid failure loss insurance (NEV21111201) New energy vehicles that have been insured with new energy vehicle loss insurance can be insured with this additional insurance. (i) During the insurance period, if the insured new energy vehicle that has been insured with this additional insurance suffers direct losses to the insured new energy vehicle due to external power grid failure during charging, and it does not belong to The scope of exemption of the insurer's liability, the insurer is responsible for compensation in accordance with the provisions of this insurance contract...>, now the customer said <what is the coverage of this external power grid failure loss insurance>, please reply", the big model outputs the corresponding words according to the dialogue context and prompt words "The external power grid failure loss insurance is specially designed for new energy vehicles. When the vehicle is damaged due to power grid failure during charging, it does not fall within the scope of liability exemption. We will compensate according to the insurance policy, and the maximum amount shall not exceed the main insurance amount. For example, if the charging pile is damaged due to power grid problems, we will be responsible for repair or compensation, and the specific amount will be determined according to the actual loss. " 3. Based on the question raised by the customer, "Oh, how much is the total amount?", the BGE model is first used to vectorize the text of "Oh, how much is the total amount?" to obtain the vector representation of "Oh, how much is the total amount?"; then the vector representation has no approximate vector in the approximate question semantic vector library; then the vector representation has no approximate vector in the insurance clause vector library; finally, assuming that the prompt text is "You are an insurance sales agent, and now the customer has said <>, please reply", after combining the customer's question and the prompt, a new prompt is obtained, "You are an insurance sales agent, and now the customer has said <Oh, how much is the total amount>, please reply", and the large model will output "Including 350 yuan of driving insurance, the total is 3536 yuan" based on the conversation context and the prompt.
[0111] In Example 2 of the present application, since the recommended speech content is based on the preset speech content corresponding to the semantic vector with similar semantics to the "semantics of the customer's question", or the speech content generated based on the customer question and the knowledge content associated with the knowledge vector similar to the target semantic vector, or the speech content generated based on the customer question and the conversation context, it can be ensured that the recommended speech content can match the customer needs expressed by the semantics of the customer question.
[0112] Example 3 Based on the same inventive concept as the above embodiments, in order to solve the problem of how to accurately recommend conversation content that matches customer needs in the prior art, the present application embodiment also provides a speech recommendation device. The specific structural diagram of the device is shown in FIG. Figure 3 As shown, it includes the following functional units: A vector conversion unit 31, used to convert the question to be answered input by the customer during the conversation into a target semantic vector representing the semantics of the input question to be answered; The first recommendation unit 32 is used to obtain a preset first speech content for responding to the semantics represented by the queried semantic vector if a semantic vector whose similarity with the target semantic vector meets a first similarity condition is queried from the semantic vector library; the semantic vector library stores various semantic vectors; the various semantic vectors are respectively used to represent the semantics of different questions to be answered that the customer is expected to input during the conversation; The query unit 33 is used to query whether there is a target knowledge vector whose similarity with the target semantic vector meets the second similarity condition from the knowledge vector library if the first recommendation unit 32 fails to query the target semantic vector; the knowledge vector library stores various knowledge vectors; the various knowledge vectors are respectively used to represent different knowledge contents involved in the business scenario to which the dialogue process belongs; A judging unit 34 is used to judge whether there is knowledge content associated with the target knowledge vector in the knowledge base if the target knowledge vector exists; The second recommendation unit 35 is used to prompt a pre-trained large language model to generate a second speech content for responding to the input question to be answered and recommend it based on the input question to be answered and the associated knowledge content if the associated knowledge content exists in the knowledge base; the knowledge base stores knowledge content associated with the knowledge vector in the knowledge vector library.
[0113] In an optional implementation, the device provided in the embodiment of the present application may further include: a third recommendation unit. The third recommendation unit is specifically used to: if the associated knowledge content does not exist in the knowledge base, based on the input question to be answered, prompt the pre-trained large language model to generate a third speech content for responding to the input question to be answered for recommendation.
[0114] In an optional implementation manner, the second recommendation unit 35 may be specifically configured to: If there are a plurality of the associated knowledge contents in the knowledge base, respectively determining the semantic relevance between the input question to be answered and the plurality of the associated knowledge contents; According to the semantic relevance, selecting knowledge content that meets a preset semantic relevance requirement from the plurality of associated knowledge content; Based on the input question to be answered and the selected knowledge content, a pre-trained large language model is prompted to generate a recommendation for the second speech content to respond to the input question to be answered.
[0115] In an optional embodiment, the pre-trained large language model is obtained by supervised fine-tuning of the pre-trained large language model based on a specific data training set; the specific data training set consists of selected customer questions; the selected customer questions are marked with labels, and the labels are selected speech content used to respond to the selected user questions.
[0116] In an optional implementation, the business scenario includes: an insurance sales scenario; the knowledge content represented by each knowledge vector includes: the content of an insurance contract clause.
[0117] The above device used in the embodiment of the present application can achieve the following beneficial effects: Since the recommended speech content is a preset first speech content corresponding to a semantic vector with similar semantics to the "semantics of the question to be answered input by the customer", or the speech content is generated based on the knowledge content associated with the input question to be answered and a knowledge vector similar to the target semantic vector, it can be ensured that the recommended speech content can match the customer needs expressed by the semantics of the question to be answered input by the customer.
[0118] Example 4 Based on the same inventive concept as the previous embodiments, the embodiments of the present application also provide an electronic device to solve the problem existing in the prior art of how to accurately recommend conversation content that matches customer needs.
[0119] like Figure 4 As shown, the electronic device includes: a memory 41 and a processor 42. The memory 41 can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application or method for operating on the electronic device. The memory 41 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.
[0120] The processor 42 is coupled to the memory 41 and is used to execute the program stored in the memory 41 to execute the speech recommendation method described in the embodiment of the present application.
[0121] When the processor 42 executes the program in the memory 41, in addition to the above functions, it can also realize other functions, and the details can be referred to the description of the previous embodiments.
[0122] Further, such as Figure 4 As shown, the electronic device also includes: a display 44, a communication component 43, a power component 45, an audio component 46 and other components. Figure 4 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 4 Components shown.
[0123] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the steps or functions of the methods provided in the above embodiments can be implemented.
[0124] Correspondingly, an embodiment of the present application further provides a computer program product, characterized in that the computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the methods provided in the above embodiments.
[0125] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for recommending speech skills, characterized in that: The method comprises: Converting the question to be answered input by the customer during the conversation into a target semantic vector representing the semantics of the question to be answered; If a semantic vector whose similarity with the target semantic vector meets the first similarity condition is queried from the semantic vector library, a preset first speech content for responding to the semantics represented by the queried semantic vector is obtained for recommendation; the semantic vector library stores various semantic vectors; the various semantic vectors are respectively used to represent the semantics of different questions to be answered that the customer is expected to input during the conversation; If the target semantic vector is not found, querying from a knowledge vector library whether there is a target knowledge vector whose similarity with the target semantic vector meets a second similarity condition; the knowledge vector library stores various knowledge vectors; and the various knowledge vectors are respectively used to represent different knowledge contents involved in the business scenario to which the dialogue process belongs; If the target knowledge vector exists, determining whether there is knowledge content associated with the target knowledge vector in the knowledge base; If the associated knowledge content exists in the knowledge base, then based on the input question to be answered and the associated knowledge content, a pre-trained large language model is prompted to generate a second speech content for responding to the input question to be answered for recommendation; the knowledge base stores knowledge content associated with the knowledge vector in the knowledge vector library.
2. The method according to claim 1, characterized in that The method further comprises: If the associated knowledge content does not exist in the knowledge base, based on the input question to be answered, a pre-trained large language model is prompted to generate a third speech content for responding to the input question to be answered for recommendation.
3. The method according to claim 1, characterized in that If the associated knowledge content exists in the knowledge base, based on the input question to be answered and the associated knowledge content, prompting a pre-trained large language model to generate a second speech content for responding to the input question to be answered for recommendation, including: If there are a plurality of the associated knowledge contents in the knowledge base, respectively determining the semantic relevance between the input question to be answered and the plurality of the associated knowledge contents; According to the semantic relevance, selecting knowledge content that meets a preset semantic relevance requirement from the plurality of associated knowledge content; Based on the input question to be answered and the selected knowledge content, a pre-trained large language model is prompted to generate a recommendation for the second speech content for responding to the input question to be answered.
4. The method according to claim 1, characterized in that The pre-trained large language model is obtained by performing supervised fine-tuning training on the pre-trained large language model based on a specific data training set; The specific data training set consists of selected customer questions; The selected customer question is marked with a label, and the label is the selected speech content used to deal with the selected user question.
5. The method according to any one of claims 1 to 4, characterized in that: The business scenarios include: insurance sales scenarios; The knowledge contents represented by the knowledge vectors include: the contents of the insurance contract clauses.
6. A speech recommendation device, characterized in that: The device comprises: A vector conversion unit, used to convert the question to be answered input by the customer during the conversation into a target semantic vector representing the semantics of the input question to be answered; The first recommendation unit is used to obtain a preset first speech content for responding to the semantics represented by the queried semantic vector if a semantic vector whose similarity with the target semantic vector meets a first similarity condition is queried from the semantic vector library; the semantic vector library stores various semantic vectors; the various semantic vectors are respectively used to represent the semantics of different questions to be answered that the customer is expected to input during the conversation; A query unit, configured to query from a knowledge vector library whether there is a target knowledge vector whose similarity with the target semantic vector meets a second similarity condition if the first recommendation unit fails to query the target semantic vector; the knowledge vector library stores various knowledge vectors; and the various knowledge vectors are respectively used to represent different knowledge contents involved in the business scenario to which the dialogue process belongs; a judgment unit, configured to judge whether there is knowledge content associated with the target knowledge vector in the knowledge base if the target knowledge vector exists; The second recommendation unit is used to prompt a pre-trained large language model to generate a second speech content for responding to the input question to be answered and recommend it based on the input question to be answered and the associated knowledge content if the associated knowledge content exists in the knowledge base; the knowledge base stores knowledge content associated with the knowledge vector in the knowledge vector library.
7. The device according to claim 6, characterized in that The second recommendation unit is specifically used for: If there are a plurality of the associated knowledge contents in the knowledge base, respectively determining the semantic relevance between the input question to be answered and the plurality of the associated knowledge contents; According to the semantic relevance, selecting knowledge content that meets a preset semantic relevance requirement from the plurality of associated knowledge content; Based on the input question to be answered and the selected knowledge content, a pre-trained large language model is prompted to generate a recommendation for the second speech content for responding to the input question to be answered.
8. An electronic device, characterized in that: include: Memory and processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to execute the speech recommendation method described in any one of claims 1 to 5.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer, can implement the speech recommendation method described in any one of claims 1 to 5.
10. A computer program product, characterized in that The computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the method described in any one of claims 1 to 5.