Customer service system construction method, customer service system, storage medium and computer equipment
By building a customer service knowledge base and training and search enhanced generative model, the problem of incomplete coverage of existing customer service systems is solved, efficient and intelligent customer service is achieved, and answer accuracy and adaptability are improved.
Patent Information
- Application Number
- CN202510264348.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-08-01
AI Technical Summary
The existing artificial intelligence customer service system lacks effective knowledge representation and reasoning mechanisms, and cannot make full use of domain knowledge, resulting in inaccurate answers, incomplete knowledge coverage and high maintenance costs.
Build a customer service knowledge base, and train the preset searcher and generator based on the target field's customer service knowledge documents, combine the user's question data set and the customer service answer data set to train the preset searcher and generator to obtain a search enhanced generation model, and connect it to the customer service platform to achieve effective integration and management of the target field knowledge.
It improves the accuracy and comprehensiveness of the customer service system when handling complex user consultations, improves scalability and flexibility, reduces maintenance costs, adapts to the needs of different fields and scenarios, and provides efficient and intelligent customer service solutions.
Smart Images

Figure CN120409655A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of customer service, and in particular, to a method for constructing a customer service system, a customer service system, a storage medium, and a computer device. Background Art
[0002] With the rapid development of Artificial Intelligence (AI) technology, the artificial intelligence customer service system has become an important means for enterprises to improve customer experience and optimize operating costs. Most of the existing artificial intelligence customer service systems answer user questions based on keyword matching or simple rule engines. When facing complex and changing user consultations, such systems often have difficulty providing accurate and comprehensive answers, resulting in poor user experience. In recent years, although pre-trained language models such as BERT (Bidirectional Encoder Representations from Transformers) and GPT (Generative Pre-trained Transformer) have been applied to the customer service system, they still face challenges in knowledge acquisition and integration when dealing with specific domain problems.
[0003] Specifically, when dealing with problems that require in-depth understanding and domain knowledge, the existing artificial intelligence customer service systems lack effective knowledge representation and reasoning mechanisms and cannot make full use of domain knowledge to enhance the answering ability, thus resulting in a series of defects. First, due to the lack of a dedicated domain knowledge base, the system is difficult to accurately answer questions involving specific domain knowledge, and the knowledge coverage is incomplete. At the same time, the answering method based on keyword matching or simple rules is prone to ignoring context information, resulting in inaccurate answers. In addition, with the update of domain knowledge, it is necessary to frequently adjust rules or retrain the model. The existing methods lack flexibility and cannot update domain knowledge in a timely manner, requiring manual maintenance and resulting in high maintenance costs. Summary of the Invention
[0004] This application mainly provides a method for constructing a customer service system, a customer service system, a storage medium, and a computer device, aiming to solve the technical problem that the existing artificial intelligence customer service model cannot make full use of domain knowledge to enhance the answering ability.
[0005] To solve the above technical problem, the technical solution adopted in this application is: to provide a method for constructing a customer service system. The method for constructing a customer service system includes: constructing a customer service knowledge base based on the customer service knowledge documents in the target domain; training a preset retriever and a preset generator based on the user question dataset, the customer service answer dataset, and the customer service knowledge base to obtain a retrieval-enhanced generation model; and connecting the customer service knowledge base and the retrieval-enhanced generation model to a customer service platform to construct the customer service system.
[0006] In some embodiments, constructing a customer service knowledge base based on the customer service knowledge documents in the target domain includes: obtaining the customer service knowledge documents in the target domain; converting the customer service knowledge documents into multiple knowledge segments based on the semantic content and layout structure of the customer service knowledge documents; and vectorizing and storing the customer service knowledge documents in a preset vector database to obtain the customer service knowledge base, where the customer service knowledge base includes vector indexes corresponding to each of the knowledge segments.
[0007] In some embodiments, obtaining the customer service knowledge documents in the target domain includes: collecting multi-source data in the target domain, where the multi-source data includes static document data and dynamic business data; and performing data cleaning on the multi-source data to obtain the customer service knowledge documents.
[0008] In some embodiments, training a preset retriever and a preset generator based on a user question dataset, a customer service answer dataset, and the customer service knowledge base to obtain a retrieval-enhanced generation model includes: obtaining the user question dataset and the corresponding customer service answer dataset; annotating each customer service answer in the customer service answer dataset based on the customer service knowledge base to determine the knowledge segment corresponding to each customer service answer; training the preset retriever based on the user questions in the user question dataset and the corresponding knowledge segments to obtain a target retriever; training the preset generator based on the knowledge segments and the corresponding customer service answers to obtain a target generator; and constructing the retrieval-enhanced generation model based on the target retriever and the target generator.
[0009] In some embodiments, training the preset retriever based on the user questions in the user question dataset and the corresponding knowledge segments to obtain a target retriever includes: inputting the user questions in the user question dataset into the preset retriever to convert the user questions into question vectors; matching the question vectors with the vector indexes in the customer service knowledge base to determine the corresponding predicted segments; and training the preset retriever based on the loss between the predicted segments and the knowledge segments to obtain the target retriever.
[0010] In some embodiments, at least one of a supervised learning algorithm, a reinforcement learning algorithm, an attention mechanism algorithm, a memory network algorithm, a decoding algorithm, and an adversarial training algorithm is integrated in the preset generator; training the preset generator based on the knowledge segments and the corresponding customer service answers to obtain a target generator includes: inputting the knowledge segments into the preset generator to generate corresponding inference answers; training the preset generator based on the loss between the inference answers and the customer service answers to obtain the target generator.
[0011] In some embodiments, after connecting the customer service knowledge base and the retrieval-enhanced generation model to the customer service platform to construct the customer service system, it further includes: collecting user feedback information, performance data, and update data; generating an adjustment instruction based on the user feedback information, the performance data, and the update data; and adjusting the retrieval-enhanced generation model or the customer service knowledge base in the customer service system based on the adjustment instruction.
[0012] To solve the above technical problems, another technical solution adopted by this application is: providing a customer service system, which includes: a customer service knowledge base constructed based on customer service knowledge documents in a target domain; a retrieval-enhanced generation model obtained by training a preset retriever and a preset generator based on a user question data set, a customer service answer data set, and the customer service knowledge base; and a customer service platform connected to the customer service knowledge base and the retrieval-enhanced generation model.
[0013] To solve the above technical problems, another technical solution adopted by this application is: providing a storage medium, on which program data is stored, and characterized in that when the program data is executed by a processor, the steps of the above customer service system construction method are implemented.
[0014] To solve the above technical problems, another technical solution adopted by this application is: providing a computer device, which includes a processor and a memory connected to each other, the memory stores a computer program, and when the processor executes the computer program, the steps of the above customer service system construction method are implemented.
[0015] The beneficial effects of this application are as follows: Different from the prior art, this application discloses a method for constructing a customer service system, a customer service system, a storage medium, and a computer device. By designing a customer service knowledge base for the target domain and training a preset retriever and a preset generator with a user question dataset and a customer service answer dataset, a retrieval-enhanced generation model is obtained. Then, the customer service knowledge base and the retrieval-enhanced generation model are connected to the customer service platform to construct a customer service system that can make full use of domain knowledge to enhance the answering ability. The constructed customer service system can effectively integrate and manage the knowledge of the target domain through the customer service knowledge base, thus solving the problem of incomplete knowledge coverage in the existing customer service system. And through the retrieval-enhanced generation model, it can quickly and accurately respond to user questions, retrieve the target domain knowledge with an attribute relationship with the user questions and generate answers, improving the answering accuracy and comprehensiveness of the customer service system when dealing with complex and changing user consultations, and further enhancing the scalability and flexibility of the customer service system. Through this method for constructing a customer service system, it can meet the requirements of different domains and scenarios, which is beneficial to improving customer service efficiency, enhancing the user experience, reducing maintenance costs, effectively solving the deficiencies in the knowledge representation and reasoning mechanism of the existing customer service system, and providing a more efficient and intelligent customer service solution for the service industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings, where:
[0017] Figure 1 is a flowchart of an embodiment of the method for constructing a customer service system provided by the present application;
[0018] Figure 2 is Figure 1 a flowchart of an embodiment of step 10 in the embodiment;
[0019] Figure 3 is Figure 2 a flowchart of an embodiment of step 11 in the embodiment;
[0020] Figure 4 is Figure 1 a flowchart of an embodiment of step 20 in the embodiment;
[0021] Figure 5 is Figure 4 a flowchart of an embodiment of step 23 in the embodiment;
[0022] Figure 6Yes Figure 4 Schematic flowchart of step 24 in an embodiment;
[0023] Figure 7 Yes Figure 1 Schematic flowchart of step 30 in an embodiment;
[0024] Figure 8 Schematic structural diagram of an embodiment of the customer service system provided by the present application;
[0025] Figure 9 Schematic structural diagram of an embodiment of the storage medium provided by the present application;
[0026] Figure 10 Schematic structural diagram of an embodiment of the computer device provided by the present application. Detailed implementation manners
[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0028] The terms "first", "second", and "third" in the embodiments of the present application are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", and "third" may explicitly or implicitly include at least one of such feature. In the description of the present application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically defined. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0029] Referring to "embodiment" in this context means that a specific feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0030] The present application provides a method for constructing a customer service system. Refer to Figure 1 ,Figure 1 It is a schematic flowchart of an embodiment of the customer service system construction method provided by this application. The customer service system construction method includes:
[0031] Step 10: Construct a customer service knowledge base based on the customer service knowledge documents in the target domain.
[0032] In this embodiment, the target domain refers to a domain related to the specific business of customer service, such as one of the fields of communication, e-commerce, finance, and healthcare. The customer service knowledge documents in the target domain include knowledge documents related to customer service in that target domain. For example, the customer service knowledge document can specifically be a tool-type document such as a frequently asked questions manual, a business process document, and a product manual that can be directly used, or it can also be a knowledge-type document such as a relevant book report, academic paper, and news information in that target domain that needs to be used after information extraction and knowledge integration. These customer service knowledge documents contain a large amount of domain knowledge and business rules and are an important basis for constructing a customer service knowledge base. These documents can specifically be in formats such as TXT, PDF, DOCX, or HTML, and this application does not make specific limitations on this.
[0033] In this embodiment, constructing a customer service knowledge base based on the customer service knowledge documents in the target domain can be achieved in various ways. For example, natural language processing technology can be used for semantic understanding and information extraction to extract key knowledge points and business rules and store them in a structured manner; text mining and topic modeling can be used to identify document topics and core concepts and form a hierarchical structure through association and classification; the documents can be represented in a vectorized manner, encoded using a vector space model, and stored in a vector database for retrieval; or a combination of manual annotation and machine learning methods can be used for document annotation and classification to extract key information points and organize and manage them; or deep learning technology can also be used for automatic summarization and generation to extract core content and store it in a structured manner. In the actual construction process of this embodiment, an appropriate knowledge base construction method can be selected according to specific business requirements and document characteristics, or a combination of multiple methods can be used for construction to improve the accuracy and integrity of the customer service knowledge base. As long as a customer service knowledge base containing relevant knowledge and rules in that target domain is constructed using the customer service knowledge documents in that target domain, it is within the protection scope of this embodiment.
[0034] This embodiment constructs a customer service knowledge base by combining customer service knowledge documents from the target domain. This effectively integrates and manages knowledge in the target domain, providing a solid data foundation for the subsequent training of retrieval-enhanced generative models and the construction of corresponding customer service systems. The construction of this customer service knowledge base not only covers a wide range of domain knowledge but also allows for continuous updating and improvement to further adapt to changes in domain knowledge, maintaining the advancement and competitiveness of the customer service system and ensuring the accuracy and timeliness of knowledge. This significantly improves the quality and efficiency of the customer service system's responses to complex user inquiries.
[0035] Optionally, see Figure 2 Based on the customer service knowledge documents in the target domain, building a customer service knowledge base can be performed as follows:
[0036] Step 11: Obtain customer service knowledge documents in the target area.
[0037] Step 12: Based on the semantic content and layout structure of the customer service knowledge document, convert the customer service knowledge document into multiple knowledge segments.
[0038] Step 13: Vectorize the customer service knowledge document and store it in a preset vector database to obtain a customer service knowledge base, which includes a vector index corresponding to each knowledge segment.
[0039] In this optional embodiment, a method for intelligent segmentation of knowledge representation is provided. Specifically, in the process of building a customer service knowledge base, the semantic content and typesetting structure of the customer service knowledge document are deeply analyzed to decompose the complex document content into multiple independent knowledge segments with clear themes. This intelligent segmentation method can be implemented in a variety of ways, such as by introducing a rule engine, dividing the paragraphs based on semantic analysis and syntactic parsing, or automatically segmenting the document content through a machine learning algorithm. In this solution, it is only necessary to use a rule engine to set corresponding rules to meet the segmentation requirements. Specifically, taking the segmentation of a customer service knowledge document in Markdown format as an example, according to the structural rules of Markdown, such as a pound sign plus a space represents a first-level title, two pound signs plus a space represent a second-level title, and an asterisk plus a space represents a list item, the structure of the Markdown document can be effectively segmented and automatically divided into chapters. Similarly, for files in other formats, typesetting structural features such as fonts, font sizes, and line spacing under different title and body styles, as well as semantic content features such as semantic coherence and contextual relationships, can be used for segmentation, thereby converting the customer service knowledge document into multiple knowledge segments.
[0040] In this alternative embodiment, after the intelligent segmentation is completed, the customer service knowledge documents need to be vectorized and stored in a preset vector database to obtain a customer service knowledge base that is convenient for subsequent retrieval and application. Among them, the preset vector database is a database that is pre-set for storing vector data. Specifically, vector databases such as Pgvector, Faiss, and Milvus can be selected. In this application, Pgvector is preferably used as the preset vector database. Although Faiss and Milvus have better performance in ultra-large-scale retrieval, their independent deployment and operation and maintenance costs are relatively high, and their matching degree with the requirements of dynamic business data integration in the present invention is relatively low. Since Pgvector is seamlessly integrated with PostgreSQL and has strong transaction support capabilities and convenient operation and maintenance, it is especially suitable for customer service scenarios that require real-time update of business data and have high consistency requirements. Therefore, using it as the preset vector database can utilize the powerful data management capabilities of PostgreSQL to conveniently implement the dynamic update and management of knowledge segments in the customer service knowledge base, which is beneficial to improving the knowledge coverage rate and answer accuracy of the customer service system.
[0041] In this alternative embodiment, during the process of vectorized storage, text vectorization technologies such as TF-IDF, Word2Vec, and BERT can be specifically used to convert each knowledge segment into a vector representation and store it in the preset vector database, and at the same time record the vector index corresponding to each knowledge segment for subsequent rapid retrieval and application. Through vectorized storage, the knowledge in the customer service knowledge base can be represented in numerical form, which is convenient for the learning and reasoning of subsequent retrieval-enhanced generation models, and improves the intelligent level and processing efficiency of the customer service system.
[0042] This alternative embodiment constructs the customer service knowledge base through the above method, which not only improves the efficiency and accuracy of knowledge integration, but also enhances the flexibility and scalability of the customer service system when processing user consultations. The customer service knowledge base can also be updated in real time to ensure the timeliness and accuracy of knowledge, enabling the customer service system to keep up with the changes in business development and user needs and provide answers and services that are more in line with user needs. At the same time, by vectorizing and storing knowledge segments and utilizing the efficient retrieval capabilities of the vector database, the customer service system can quickly locate relevant knowledge content, further improving the speed and accuracy of answers. In addition, the construction method of this customer service knowledge base can also be flexibly adjusted and optimized according to different business requirements and document characteristics to adapt to the application requirements of different fields and scenarios, providing a solid foundation for the efficient operation and intelligent service of the customer service system.
[0043] Optionally, referring to Figure 3 , in one embodiment, to obtain the customer service knowledge documents in the target field, the following steps can be executed:
[0044] Step 111: Collect multi-source data in the target domain. The multi-source data includes static document data and dynamic business data.
[0045] Step 112: Clean the multi-source data to obtain a customer service knowledge document.
[0046] In this alternative embodiment, it is specified that the customer service knowledge document is obtained by cleaning multi-source data from multiple data sources in the target domain. Among them, the static document data included in the multi-source data can specifically be professional books, industry reports, website forum snapshots, or open-source datasets, etc. These data usually have high authority and reference value, and can provide rich background knowledge and professional insights for the customer service knowledge base. The dynamic business data in the multi-source data refers to the data generated during the actual business operation process, such as order data, account information, and transaction records, etc. These data can reflect user needs and business changes in real time, and provide the latest business information and user feedback for the customer service knowledge base. By comprehensively collecting and analyzing these multi-source data, it is possible to understand the business rules and user problems in the target domain more comprehensively, thereby constructing a more accurate and practical customer service knowledge base.
[0047] In this alternative embodiment, the main purpose of data cleaning is to remove noise, redundancy, and error information in the data to improve the quality and usability of the data. Specifically, data cleaning can include operations such as removing duplicate data, correcting error data, filling in missing data, and standardizing data formats. By cleaning the multi-source data, it is possible to effectively extract the customer service knowledge document therein, remove redundant, error, and irrelevant information, ensure the accuracy and consistency of the knowledge, and provide a reliable data basis for the subsequent construction of the customer service knowledge base.
[0048] In this alternative embodiment, during the process of data cleaning, technical means such as natural language processing, data mining, and machine learning can also be combined to conduct more in-depth analysis and processing of the multi-source data. For example, natural language processing technology can be used to perform semantic analysis and sentiment analysis on text data to extract key information and sentiment tendencies therein; data mining technology can be used to conduct association analysis and clustering analysis on the data to discover potential rules and patterns therein; machine learning technology can also be used to classify and predict the data to improve the accuracy and efficiency of data processing. The application of these technical means can further improve the quality and practicality of the customer service knowledge base, and provide more powerful support for the intelligent service of the customer service system.
[0049] Step 20: Train a preset retriever and a preset generator based on the user question dataset, the customer service answer dataset, and the customer service knowledge base to obtain a retrieval-enhanced generation model.
[0050] In this embodiment, the user question dataset refers to the set of various questions raised by users during the customer service consultation process, while the customer service answer dataset is the set of answers and solutions given by customer service staff in response to the corresponding user questions. This user question dataset and customer service answer dataset are generated during the actual customer service process, with high authenticity and representativeness, and can reflect the actual needs of user consultations and the common patterns of customer service answers. The user questions and customer service answers therein can be screened in advance. For example, questions and answers unrelated to the customer service business can be removed, and only data related to the target field is retained to improve the pertinence and accuracy of the model. At the same time, the questions and answers can also be labeled and classified for better subsequent model training and evaluation.
[0051] In this embodiment, the preset retriever is a module used to retrieve knowledge content related to user questions from the customer service knowledge base. It can encode the input information into vectors through built-in query encoders such as text2vec-base-chinese, LaBSE, or XLM-RoBERTa, etc., so as to perform efficient similarity calculation and matching in the vector space to quickly locate the knowledge content related to user questions. The preset generator is a module that generates answers and solutions based on the retrieved knowledge content and user questions. By integrating semantic generation models such as large models like GPT, BERT, or other untrained generative models, it can understand and generate natural language text, and thus generate corresponding answers according to the retrieved knowledge content and the context information of user questions.
[0052] In this embodiment, by training the preset retriever and preset generator, the corresponding models can learn the characteristics of user questions and the attribute relationships of customer service knowledge, so as to realize the function of automatically generating accurate answers according to user questions. During the training process, the user question dataset and customer service answer dataset can be used as training samples and input into the preset retriever and preset generator for training. At the same time, the knowledge content in the customer service knowledge base can also be combined to perform knowledge enhancement training on the model to improve the answer quality and accuracy of the model. After training is completed, the trained retriever and generator can be coupled to obtain a Retrieval-augmented Generation (RAG) model, which can automatically generate relevant answers and solutions according to user questions, realizing the intelligent service of the customer service system.
[0053] Optionally, refer to Figure 4 In one embodiment, based on the user question dataset, customer service answer dataset, and customer service knowledge base, training the preset retriever and preset generator to obtain a retrieval-augmented generation model can be performed according to the following steps:
[0054] Step 21: Obtain the user question dataset and the corresponding customer service answer dataset.
[0055] Step 22: Based on the customer service knowledge base, annotate each customer service answer in the customer service answer dataset to determine the corresponding knowledge segments of each customer service answer.
[0056] Step 23: Based on the user questions in the user question dataset and the corresponding knowledge segments, train a preset retriever to obtain a target retriever.
[0057] Step 24: Based on the knowledge segments and the corresponding customer service answers, train a preset generator to obtain a target generator.
[0058] Step 25: Based on the target retriever and the target generator, construct a retrieval-enhanced generation model.
[0059] In this optional embodiment, the detailed steps of training and optimizing the preset retriever and the preset generator in the process of training the retrieval-enhanced generation model are specifically described. Specifically, based on the customer service knowledge base, the source and corresponding labels of the knowledge segments corresponding to each customer service answer can be known, so as to annotate them. Among them, the source of the knowledge segments can specifically be the aforementioned static document data or dynamic business data, and the label categories can cover dimensions such as specific fields, related products or functional modules, entity machines and timeliness. In the annotation process, the balance between efficiency and accuracy can be achieved through a semi-automated process. For example, auxiliary means such as rule engines and preset templates can be used to improve the annotation efficiency.
[0060] In this alternative embodiment, after the annotation is completed, the preset retriever can be trained based on these annotation data so that it can learn the attribute relationship between the user's question and the knowledge segments in the customer service knowledge base, improving the accuracy and efficiency of retrieval, enabling the corresponding target retriever to effectively identify the semantic boundaries and entities of unstructured text, and thus being able to output tags associated with the input user question. At the same time, after the model annotation is completed, an evaluation mechanism for the confidence and compliance of the prediction results can also be introduced. Tags that meet the corresponding confidence and compliance can be directly output, while tags that do not meet the confidence and compliance need to be reviewed and corrected through a manual review process. In addition, annotation platforms such as Label Studio can be integrated into the preset retriever to achieve efficient collaboration. Through the application of intelligent annotation tools, the annotation efficiency and accuracy are further improved, ensuring the annotation quality. After the annotation is completed, these tagged data will be used to train the preset retriever. The trained target retriever can effectively understand the semantic features and intentions of the user's question, encode the user's question into a vector, map it into a high-dimensional space, and match it with the vector index in the customer service knowledge base to accurately retrieve the knowledge segment in the customer service knowledge base that is most relevant to the user's question, providing a reliable knowledge basis for subsequent answer generation. At the same time, the target retriever also has high retrieval efficiency and accuracy, can respond to the user's question in real time, and improves the response speed and answer quality of the customer service system.
[0061] In this alternative embodiment, the process of training the preset generator is to construct training samples based on the knowledge segments and the corresponding customer service answers. Specifically, the knowledge segments can be used as input information, and the corresponding customer service answers can be used as the target output. Through repeated learning and iterative optimization, the preset generator can gradually master the mapping relationship from the knowledge segments to the customer service answers. During the training process, a loss function can be used to evaluate the difference between the answer generated by the generator and the real customer service answer. By minimizing the loss function, the parameters of the generator are continuously adjusted to improve the accuracy and fluency of the generated answer. After the training is completed, the obtained target generator can automatically generate natural, accurate, and user-demand-compliant answers according to the retrieved knowledge segments and in combination with the context information of the user's question. The target generator not only improves the automation degree of the customer service answer but also enhances the intelligent level and user experience of the customer service system.
[0062] In this alternative embodiment, after training the above-mentioned target retriever and target generator, the two modules can be integrated and coupled to construct a complete retrieval-enhanced generation model. During the integration process, it is necessary to ensure data interaction and collaborative work between the target retriever and the target generator, so that when a user question is input into the model, the target retriever can first quickly retrieve relevant knowledge segments and pass these segments as input information to the target generator. Subsequently, based on the retrieved knowledge segments and the context information of the user question, the target generator generates corresponding answers and solutions. Through this integration method, the constructed retrieval-enhanced generation model can make full use of the knowledge resources in the customer service knowledge base and combine the specific questions of users to provide accurate, timely, and useful answers, thus greatly improving the intelligence level and user satisfaction of the customer service system. At the same time, the model also has good scalability and flexibility, can adapt to the application requirements of different fields and scenarios, and provides strong support for the efficient operation and high-quality service of the customer service system.
[0063] Optionally, referring to Figure 5 , in one embodiment, based on the user questions and corresponding knowledge segments in the user question dataset, train a preset retriever to obtain a target retriever, which can be performed according to the following steps:
[0064] Step 231: Input the user questions in the user question dataset into the preset retriever to convert the user questions into question vectors.
[0065] Step 232: Match the question vectors with the vector indexes in the customer service knowledge base to determine the corresponding predicted segments.
[0066] Step 233: Train the preset retriever based on the loss between the predicted segments and the knowledge segments to obtain the target retriever.
[0067] In this alternative embodiment, the process of training a preset retriever to obtain a target retriever is specified. Among them, the process of converting a user question into a question vector is implemented by a query encoder built into the preset retriever, such as the aforementioned text2vec-base-chinese, LaBSE, or XLM-RoBERTa, etc. This query encoder can encode the text information of the user question into a vector form for efficient similarity calculation and matching in the vector space. The vector index is the vector representation corresponding to each knowledge segment in the customer service knowledge base. By comparing the similarity between the question vector and the vector index, the prediction segment related to the user question can be initially determined. Subsequently, based on the loss between the prediction segment and the true knowledge segment, the preset retriever is trained and optimized to enable it to more accurately identify the knowledge segment related to the user question. During the training process, a cross-entropy loss function or other suitable loss function can be used to evaluate the difference between the prediction segment and the true segment. By minimizing the loss function, the parameters of the preset retriever are continuously adjusted to improve the accuracy and efficiency of its retrieval. After training, the obtained target retriever can more accurately understand the semantic features and intentions of the user question and quickly retrieve the knowledge segment in the customer service knowledge base that is most relevant to the user question, providing a more reliable knowledge basis for subsequent answer generation.
[0068] Optionally, referring to Figure 6 , in one embodiment, at least one of a supervised learning algorithm, a reinforcement learning algorithm, an attention mechanism algorithm, a memory network algorithm, a decoding algorithm, and an adversarial training algorithm is integrated into the preset generator; based on the knowledge segment and the corresponding customer service answer, the preset generator is trained to obtain a target generator, which can be executed according to the following steps:
[0069] Step 241: Input the knowledge segment into the preset generator to generate a corresponding reasoning answer.
[0070] Step 242: Based on the loss between the reasoning answer and the customer service answer, train the preset generator to obtain a target generator.
[0071] In this alternative embodiment, various techniques can be integrated into the preset generator to optimize its generation process. Among them, the supervised learning algorithm refers to training a model to minimize the difference between the predicted answer and the actual answer, enabling the generator to gradually master the mapping relationship from knowledge segments to customer service answers; the reinforcement learning algorithm means guiding the model to generate more compliant answers by giving rewards or punishments to the model; the attention mechanism algorithm enables the generator to focus on the key information in the input knowledge segments, improving the accuracy and relevance of the generation; the memory network algorithm helps the model remember previous conversations and contexts to generate more coherent and consistent answers; the decoding algorithm is responsible for converting the internal representation of the model into natural language text; the adversarial training algorithm enhances the robustness and generalization ability of the model by introducing adversarial samples. Through the comprehensive application of these algorithms in this application, the performance of the preset generator can be further improved, making the generated answers more natural, accurate, and meeting user needs.
[0072] In this alternative embodiment, during the process of training the preset generator, first, the knowledge segments are passed as input information to the preset generator, and the preset generator generates corresponding inference answers based on the algorithms and techniques integrated within it. Then, by comparing the difference between the inference answer and the real customer service answer, an appropriate loss function is used to evaluate the quality of the answer generated by the generator. Based on this loss, the preset generator is trained and optimized, continuously adjusting its internal parameters to minimize the difference between the inference answer and the real answer. After the training is completed, the obtained target generator can generate more natural, accurate, and user-demand-compliant answers according to the retrieved knowledge segments in combination with the context information of the user's question. This target generator not only improves the automation level of customer service answers but also significantly enhances the intelligence level of the customer service system, which is beneficial to further improving the user experience.
[0073] Step 30: Connect the customer service knowledge base and the retrieval-enhanced generation model to the customer service platform to build a customer service system.
[0074] In this embodiment, the customer service platform refers to the core platform used to receive and process user questions. This customer service platform has an interface for interacting with users and can receive questions submitted by users through different channels, such as web pages, software applications, and mini-programs, and transfer these questions to the retrieval-enhanced generation model at the back end for processing. A user-friendly interface and a back-end management subsystem are usually set up in the customer service platform. Among them, the user-friendly interface is the interface for displaying the answers and solutions generated by the model, which can provide users with an intuitive and easy-to-use interaction experience. Users can input questions and obtain answers through text or voice by using the controls provided by the user-friendly interface, such as search boxes, drop-down lists, buttons, etc., to realize the interaction between the user and the customer service system. The back-end management subsystem, on the other hand, is the interface for configuring and managing the customer service system. Administrators can monitor the running status and performance indicators of the customer service system in real time through the back-end management subsystem, and can update and maintain the customer service knowledge base, as well as optimize and monitor the retrieval-enhanced generation model to ensure the normal operation and high-quality service of the customer service system.
[0075] In this alternative embodiment, by connecting the customer service knowledge base and the retrieval-enhanced generation model to the customer service platform, an intelligent customer service system can be constructed. Specifically, the customer service knowledge base stores a large amount of customer service knowledge and experience, which are derived from historical conversation records, frequently asked questions answers, product manuals, business knowledge, etc. Through sorting, classification, and annotation, a structured knowledge representation is formed, which is convenient for subsequent retrieval and use. The retrieval-enhanced generation model, as the core component of the customer service system, is responsible for receiving user questions and automatically generating relevant answers and solutions according to the knowledge content in the customer service knowledge base. When a user submits a question through the interaction interface of the customer service platform, the customer service platform transfers these questions to the retrieval-enhanced generation model at the back end. The model first uses the target retriever to quickly retrieve the knowledge segments related to the user question from the customer service knowledge base, and then, based on these knowledge segments and the context information of the user question, generates natural, accurate, and user-demand-compliant answers through the target generator. The generated answers will be displayed to the user through the user-friendly interface of the customer service platform, realizing the intelligent interaction between the user and the customer service system. At the same time, administrators can monitor and manage the customer service system in real time through the back-end management subsystem to ensure the normal operation and high-quality service of the customer service system.
[0076] The file system constructed in the above manner in this alternative embodiment can effectively integrate and manage the knowledge in the target domain through the customer service knowledge base, thus solving the problem of incomplete knowledge coverage in the existing customer service system. And through the retrieval-augmented generation model, it can quickly and accurately respond to users' questions, retrieve the target domain knowledge with an attribute relationship to the users' questions and generate answers, improving the accuracy and comprehensiveness of the answers when the customer service system processes complex and changing user consultations, and further enhancing the scalability and flexibility of the customer service system. Through this customer service system construction method, it can adapt to the requirements of different domains and scenarios, which is conducive to improving customer service efficiency, enhancing the user experience, reducing maintenance costs, effectively solving the deficiencies in the knowledge representation and reasoning mechanism of the existing customer service system, and providing a more efficient and intelligent customer service solution for the service industry.
[0077] Optionally, referring to Figure 7 , in one embodiment, after connecting the customer service knowledge base and the retrieval-augmented generation model to the customer service platform to construct the customer service system, it further includes:
[0078] Step 31: Collect user feedback information, performance data, and update data.
[0079] Step 32: Generate an adjustment instruction based on the user feedback information, performance data, and update data.
[0080] Step 33: Adjust the retrieval-augmented generation model or the customer service knowledge base in the customer service system based on the adjustment instruction.
[0081] In this alternative embodiment, the update and maintenance processing of the customer service system after its construction is specified. Among them, user feedback refers to the feedback opinions of users on the answers and solutions provided by the customer service system. These feedback opinions can be collected through user evaluations, satisfaction surveys, online reviews, etc., reflecting the direct feelings of users about the performance and quality of the customer service system. For example, for each answer, users can give a like or a mark, or give specific evaluations and suggestions. Performance data refers to various performance indicators generated during the operation of the customer service system, such as response time, accuracy rate, recall rate, etc. These indicators can objectively reflect the operation status and efficiency of the customer service system. For example, according to the number of users supported, if the answer speed is slow, it can indicate adding corresponding processor resources or memory resources subsequently. Update data refers to the newly added or updated knowledge content in the customer service knowledge base. These contents may come from new product releases, business rule changes, common question updates, etc., and need to be updated to the customer service knowledge base in a timely manner to maintain the timeliness and accuracy of the customer service system.
[0082] In this alternative embodiment, after collecting user feedback information, performance data, and update data, the system can generate adjustment instructions based on this data. Adjustment instructions refer to specific improvement measures and optimization suggestions proposed for the problems and deficiencies in the customer service system. These instructions can be automatically generated by the system or manually formulated by the administrator based on the analysis results of the data. The content of the adjustment instructions may include improving the retrieval algorithm, optimizing the generation model, updating the customer service knowledge base, adjusting system parameters, etc., aiming to improve the performance and quality of the customer service system and meet the needs and expectations of users. Finally, based on the adjustment instructions, the retrieval-enhanced generation model or the customer service knowledge base in the customer service system can be adjusted. This adjustment process can be automatic or manual, depending on the content of the adjustment instructions and the implementation method of the system. Through continuous adjustment and optimization, the customer service system can gradually improve its performance and quality, better meet the needs and expectations of users, and enhance the user experience and satisfaction. At the same time, this update and maintenance mechanism also ensures that the customer service system can adapt to the changing target domain environment and user needs, maintain its competitiveness and vitality, and effectively improve the scalability and maintenance cost of the customer service system.
[0083] Refer to Figure 8 , Figure 8 FIG. is a schematic structural diagram of an embodiment of the customer service system provided by this application. The customer service system 40 includes: a customer service knowledge base 41, which is constructed based on customer service knowledge documents in the target domain; a retrieval-enhanced generation model 42, which is obtained by training a preset retriever and a preset generator based on a user question data set, a customer service answer data set, and the customer service knowledge base 41; and a customer service platform 43, which accesses the customer service knowledge base 41 and the retrieval-enhanced generation model 42.
[0084] In this embodiment, it can be understood that the customer service system 40 is constructed based on the customer service system construction method described above Figures 1 to 7 . Among them, the customer service knowledge base 41 stores a large amount of customer service knowledge and experience in the target domain. Through sorting, classification, and annotation, these knowledge and experience form a structured knowledge representation, which is convenient for subsequent retrieval and use. As the core component of the customer service system, the retrieval-enhanced generation model 42 has the capabilities of fast retrieval and intelligent generation. It can receive user questions and automatically generate relevant answers and solutions according to the knowledge content in the customer service knowledge base. The customer service platform 43, as the interface for users to interact with the customer service system, has a user-friendly interface and a background management subsystem, which can provide users with an intuitive and easy-to-use interaction experience and allow the administrator to monitor and manage the customer service system in real time. By using the customer service system 40, the effective integration and management of knowledge in the target domain can be realized, user questions can be quickly and accurately responded to and answers can be generated, significantly improving the customer service efficiency and improving the user experience.
[0085] Since the embodiments of the customer service system correspond to the embodiments of the above method, for the introduction of the customer service system provided in the embodiments of the present invention, please refer to the embodiments of the above method. The embodiments of the present invention will not be described in detail herein, and it has the same beneficial effects as the above customer service system construction method.
[0086] Refer to Figure 9 , Figure 9 which is a schematic structural diagram of an embodiment of the storage medium provided by the present application.
[0087] The storage medium 50 stores program data 51. When the program data 51 is executed by a processor, it implements the customer service system construction method as Figures 1 to 7 described.
[0088] The program data 51 is stored in a storage medium 50 and includes several instructions for causing a network device (which can be a router, a personal computer, a server, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0089] Optionally, the storage medium 50 can be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc., which can store the program data 51.
[0090] Refer to Figure 10 , Figure 10 which is a schematic structural diagram of an embodiment of the computer device provided by the present application.
[0091] The computer device 60 includes a processor 62 and a memory 61 connected to each other. The memory 61 stores a computer program. When the processor 62 executes the computer program, it implements the customer service system construction method as Figures 1 to 7 described. Among them, the memory 61 can include the storage medium 50 or can be other separately developed memories.
[0092] Different from the prior art, the present application discloses a method for constructing a customer service system, a customer service system, a storage medium, and a computer device. By designing a customer service knowledge base for the target domain and training a preset retriever and a preset generator in combination with a user question dataset and a customer service answer dataset, a retrieval-enhanced generation model is obtained. Then, the customer service knowledge base and the retrieval-enhanced generation model are connected to a customer service platform to construct a customer service system that can make full use of domain knowledge to enhance the answering ability. The constructed customer service system can effectively integrate and manage the knowledge of the target domain through the customer service knowledge base, thus solving the problem of incomplete knowledge coverage of the existing customer service system. And through the retrieval-enhanced generation model, it can quickly and accurately respond to user questions, retrieve the target domain knowledge with an attribute relationship with the user questions and generate answers, improving the answering accuracy and comprehensiveness of the customer service system when dealing with complex and changeable user consultations, and further enhancing the scalability and flexibility of the customer service system. Through this method for constructing a customer service system, it can adapt to the needs of different domains and scenarios, is beneficial to improving customer service efficiency, enhancing the user experience, reducing maintenance costs, effectively solving the deficiencies in the knowledge representation and reasoning mechanism of the existing customer service system, and providing a more efficient and intelligent customer service solution for the service industry.
[0093] Each embodiment in this specification is described in a progressive manner, and the same or similar parts among the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, the storage medium embodiment, and the computer device embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0094] The present application can be used in many general-purpose or special-purpose computing system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on.
[0095] In several implementation manners provided by the present application, it should be understood that the disclosed methods, systems, storage media, and computer devices can be implemented in other ways. For example, the above-described implementation manner of the customer service system is merely illustrative. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0096] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0097] In addition, each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0098] The above are only the embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A method for constructing a customer service system, characterized in that Including: Construct a customer service knowledge base based on the customer service knowledge documents in the target domain; Train a preset retriever and a preset generator based on the user question dataset, the customer service answer dataset, and the customer service knowledge base to obtain a retrieval-enhanced generation model; Connect the customer service knowledge base and the retrieval-enhanced generation model to a customer service platform to construct the customer service system.
2. The method for constructing a customer service system according to claim 1, wherein The constructing a customer service knowledge base based on the customer service knowledge documents in the target domain includes: Obtain the customer service knowledge documents in the target domain; Based on the semantic content and layout structure of the customer service knowledge documents, convert the customer service knowledge documents into multiple knowledge segments; Vectorize and store the customer service knowledge documents in a preset vector database to obtain the customer service knowledge base, where the customer service knowledge base includes vector indexes corresponding to each of the knowledge segments.
3. The method for constructing a customer service system according to claim 2, wherein The obtaining the customer service knowledge documents in the target domain includes: Collect multi-source data in the target domain, where the multi-source data includes static document data and dynamic business data; Clean the multi-source data to obtain the customer service knowledge documents.
4. The method for constructing a customer service system according to claim 2, wherein The training a preset retriever and a preset generator based on the user question dataset, the customer service answer dataset, and the customer service knowledge base to obtain a retrieval-enhanced generation model includes: Obtain the user question dataset and the corresponding customer service answer dataset; Based on the customer service knowledge base, annotate each customer service answer in the customer service answer dataset to determine the knowledge segment corresponding to each customer service answer; Train the preset retriever based on the user questions in the user question dataset and the corresponding knowledge segments to obtain a target retriever; Train the preset generator based on the knowledge segments and the corresponding customer service answers to obtain a target generator; Construct the retrieval-enhanced generation model based on the target retriever and the target generator.
5. The method for constructing a customer service system according to claim 4, wherein The training the preset retriever based on the user questions in the user question dataset and the corresponding knowledge segments to obtain a target retriever includes: Input the user questions in the user question dataset into the preset retriever to convert the user questions into question vectors; Match the question vectors with the vector indexes in the customer service knowledge base to determine the corresponding predicted segments; Train the preset retriever based on the loss between the predicted segments and the knowledge segments to obtain the target retriever.
6. The method for constructing a customer service system according to claim 4, wherein, At least one of a supervised learning algorithm, a reinforcement learning algorithm, an attention mechanism algorithm, a memory network algorithm, a decoding algorithm, and an adversarial training algorithm is integrated in the preset generator; The training the preset generator based on the knowledge segments and the corresponding customer service answers to obtain a target generator includes: Input the knowledge segments into the preset generator to generate corresponding inference answers; Train the preset generator based on the loss between the inference answers and the customer service answers to obtain the target generator.
7. The method for constructing a customer service system according to claim 1, characterized in that After connecting the customer service knowledge base and the retrieval-enhanced generation model to the customer service platform to build the customer service system, the following steps are further included: Collect user feedback information, performance data, and update data; Generate adjustment instructions based on the user feedback information, the performance data, and the update data; Adjust the retrieval-enhanced generation model or the customer service knowledge base in the customer service system based on the adjustment instructions.
8. A customer service system, characterized in that, It includes: A customer service knowledge base, which is built based on customer service knowledge documents in the target domain; A retrieval-enhanced generation model, which is obtained by training a preset retriever and a preset generator based on a user question dataset, a customer service answer dataset, and the customer service knowledge base; A customer service platform, which connects to the customer service knowledge base and the retrieval-enhanced generation model.
9. A storage medium having program data stored thereon, characterized in that, When the program data is executed by a processor, the steps of the customer service system construction method according to any one of claims 1 to 7 are implemented.
10. A computer device, characterized in that, It includes a processor and a memory connected to each other. The memory stores a computer program. When the processor executes the computer program, the steps of the customer service system construction method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Abnormal communication identification method and device, medium and product
CN120979906A
Financial customer service RAG knowledge base updating method and device and storage medium
CN121882192A