Customer service question and answer statement generation method, customer service system, device and medium
By introducing the collaboration of planning, question-answering, and recommendation agents into the customer service system, customer service Q&A statements that combine question answering and recommendation are generated, solving the problems of inaccurate user question answers and marketing recommendations in existing technologies, and improving the effectiveness of Q&A services.
Patent Information
- Application Number
- CN202411998921.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing customer service Q&A systems are unable to effectively answer complex user questions and tend to make mechanical marketing recommendations, resulting in a poor user experience.
The planning agent identifies the target question-answering agent, generates question-answer data, and decides whether to provide recommendation services based on the preset question-answering strategy. Finally, the summarizing agent generates customer service question-answering statements that combine question-answering and recommendation.
It improved the generation of customer service Q&A statements, ensured the accuracy of question answers, avoided unnecessary marketing recommendations, and enhanced the user experience.
Smart Images

Figure CN119917630B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular to a customer service question and answer sentence generation method, a customer service system, a device and a medium. BACKGROUND
[0002] In an e-commerce application scenario, in order to improve the efficiency of question and answer, an intelligent customer service is usually used to answer the questions raised by users and provide product recommendation services to the users.
[0003] However, in the existing customer service question and answer sentence generation method, due to the complexity and diversity of the questions raised by users, the question and answer sentences generated by the intelligent customer service cannot effectively answer the user questions,
[0004] In addition, after answering the user questions, the intelligent customer service will perform mechanical marketing recommendation, thereby causing excessive marketing recommendation and repeated recommendation problems, resulting in poor user experience. SUMMARY
[0005] Therefore, the present disclosure provides a customer service question and answer sentence generation method, a customer service system, a device and a medium to solve the problem of poor effect of the customer service question and answer sentence generated in the question and answer service and recommendation scenario in the prior art.
[0006] To achieve the above-mentioned purpose, the first aspect of the present disclosure provides a customer service question and answer sentence generation method, comprising:
[0007] Based on a planning agent, according to the problem type corresponding to a target question and the function description information corresponding to a plurality of question and answer agents, a target question and answer agent for processing the target question is determined from the plurality of question and answer agents;
[0008] Based on the target question and answer agent, the target question is processed to generate question answer data corresponding to the target question;
[0009] Based on the planning agent, according to the target question, the question answer data corresponding to the target question and a preset question and answer strategy, it is determined whether to perform a preset recommendation service, and in the case of determining to perform a preset recommendation service, a recommendation agent is used to generate recommendation data corresponding to the target question;
[0010] Based on a summary agent, according to the question answer data and the recommendation data, a customer service question and answer sentence corresponding to the target question is generated.
[0011] In an optional implementation manner, the question and answer agent includes a query type agent and a knowledge type agent, and in the case that the target question and answer agent is the query type agent, the processing of the target question based on the target question and answer agent to generate the question answer data corresponding to the target question includes:
[0012] inputting the target question, a plurality of interface description information corresponding to a plurality of preset query interfaces into the query type agent, so that the query type agent selects a target query interface corresponding to the target question from the plurality of preset query interfaces according to the plurality of interface description information, and generates parameter information corresponding to the target query interface according to the target question;
[0013] matching the parameter information with preset parameter terms, and updating the parameter information according to a matching result;
[0014] running the target query interface according to the updated parameter information, and generating question answering data corresponding to the target question according to a running result of the target query interface.
[0015] In an optional implementation manner, the matching the parameter information with preset parameter terms comprises:
[0016] extracting a first preset parameter term corresponding to a parameter type matched with the parameter information from product sample information, matching the parameter information with the first preset parameter term to obtain a first matching result;
[0017] regularly matching the parameter information with a second preset parameter term in a preset parameter library to obtain a second matching result;
[0018] obtaining the matching result according to the first matching result and the second matching result.
[0019] In an optional implementation manner, in a case where the target question answering agent is the knowledge type agent, the generating question answering data corresponding to the target question based on the target question answering agent processing the target question comprises:
[0020] sharding preset document knowledge data to obtain a plurality of data shards corresponding to the preset document knowledge data;
[0021] extracting a target keyword from the target question, generating an associated keyword having an association relationship with the target keyword according to a term semantic of the target keyword, and taking the target keyword and the associated keyword as a retrieval keyword;
[0022] retrieving a target data shard corresponding to the retrieval keyword from the plurality of data shards according to the retrieval keyword;
[0023] input the target question and the target data shard into the knowledge type agent, so that the knowledge type agent generates question answering data corresponding to the target question according to the target data shard.
[0024] In an optional implementation, the recommendation agent generates the recommendation data corresponding to the target question, including:
[0025] obtain associated dialogue data corresponding to the target question from historical dialogue data;
[0026] perform vector matching on the associated dialogue data and a plurality of preset recommendation case data, and select target recommendation case data corresponding to the associated dialogue data according to a vector matching result;
[0027] generate prompt information according to the target recommendation case data and the preset answering strategy, and input the prompt information into the recommendation agent, so that the recommendation agent generates the recommendation data corresponding to the target question according to the prompt information.
[0028] In an optional implementation, the preset question answering strategy and the preset recommendation case data are generated in the following manner:
[0029] perform information extraction on each dialogue data in historical dialogue data, to obtain a question answering strategy corresponding to the dialogue data and a dialogue result corresponding to the dialogue data;
[0030] determine a number of positive samples and a number of negative samples corresponding to a question answering strategy according to dialogue results corresponding to a plurality of dialogue data corresponding to the question answering strategy;
[0031] calculate a strategy effectiveness of the question answering strategy according to the number of positive samples and the number of negative samples corresponding to the question answering strategy;
[0032] in a case where the strategy effectiveness is higher than a preset threshold, take the question answering strategy as the preset question answering strategy, and generate the preset recommendation case data according to dialogue data corresponding to the question answering strategy.
[0033] In an optional implementation, the summary agent is trained according to a preset question and a question answering sentence in a preset question style corresponding to the preset question, and the generating, by the summary agent, of the customer service question answering sentence corresponding to the target question according to the question answering data and the recommendation data includes:
[0034] perform data padding processing and / or redundant data filtering processing on the question answering data and the recommendation data;
[0035] The processed question answering data and the recommendation data are input into the summary agent, so that the summary agent generates a customer service question and answer sentence corresponding to the target question according to the preset dialogue style.
[0036] The second aspect of the present disclosure provides a customer service system, comprising: a planning agent, a question and answer agent, a summary agent, and a recommendation agent.
[0037] The planning agent is configured to determine a target question and answer agent for processing the target question from a plurality of question and answer agents according to a question type corresponding to the target question and function description information corresponding to the plurality of question and answer agents.
[0038] The question and answer agent is configured to process the target question and generate question answering data corresponding to the target question.
[0039] The planning agent is further configured to determine whether to perform a preset recommendation service according to the target question, the question answering data corresponding to the target question, and a preset question and answer strategy.
[0040] The recommendation agent is configured to generate recommendation data corresponding to the target question when it is determined to perform the preset recommendation service.
[0041] The summary agent is configured to generate a customer service question and answer sentence corresponding to the target question according to the question answering data and the recommendation data.
[0042] The third aspect of the present disclosure provides an electronic device, comprising:
[0043] One or more processors;
[0044] A storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for generating a customer service question and answer sentence.
[0045] One or more I / O interfaces connected between the processor and the memory, configured to realize information interaction between the processor and the memory.
[0046] The fourth aspect of the present disclosure provides a computer readable medium having a computer program stored thereon, the program being executed by a processor to implement the above-mentioned method for generating a customer service question and answer sentence.
[0047] The present disclosure has the following advantages:
[0048] In the embodiments of the present disclosure, the customer service answering sentences with both question and answer services and recommendation dual goals are generated through the interaction and cooperation between intelligent agents with different roles. The target question answering agent for processing the target question is determined from different question answering agents according to the question type corresponding to the target question and the function description information corresponding to the plurality of question answering agents by the planning agent. The question answering agent generates the question answering data in a targeted manner, which ensures the data accuracy of the question answering data. In addition, the planning agent further confirms whether the recommendation service needs to be performed according to the question answering data generated by the question answering agent and the preset question answering strategy. Only in the case where the recommendation service needs to be performed, the recommendation data corresponding to the target question is generated based on the recommendation agent, which avoids the mechanical marketing recommendation after answering the user's question. Finally, the summary agent summarizes the question answering data and the recommendation data generated to generate the final customer service question and answer sentence, which improves the generation effect of the customer service question and answer sentence in the question and answer service and recommendation scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0049] The accompanying drawings are included to provide a further understanding of the present disclosure and constitute a part of the specification, which together with the specific embodiments described below, serve to explain the present disclosure but do not constitute a limitation thereof.
[0050] Figure 1 A flowchart of a method for generating a customer service question and answer sentence is provided for the embodiments of the present disclosure.
[0051] Figure 2 A schematic diagram of a method for generating a customer service question and answer sentence is provided for the embodiments of the present disclosure.
[0052] Figure 3 An application schematic diagram of each intelligent agent in the embodiments of the present disclosure is provided.
[0053] Figure 4 A block diagram of a customer service system is provided for the embodiments of the present disclosure.
[0054] Figure 5 A block diagram of an electronic device is provided for the embodiments of the present disclosure. DETAILED DESCRIPTION
[0055] The specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure, and are not used to limit the present disclosure.
[0056] As used in the present disclosure, the term "and / or" includes any and all combinations of one or more of the relevant listed items.
[0057] The terminology used by the disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0058] When the term "comprising" or "made of" is used in the present disclosure, it specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0059] The embodiments described in the present disclosure can be described with reference to plan views and / or cross-sectional views by virtue of the idealized schematic drawings of the present disclosure. Thus, the example illustrations can be modified according to manufacturing techniques and / or tolerances.
[0060] Unless otherwise defined, all terms (including technical and scientific terms) used in the present disclosure have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an overly formal or overly strict sense unless expressly so defined in the present disclosure.
[0061] In the e-commerce customer service dialogue scene, the user questions are various and complex, which causes the question and answer sentences generated by the intelligent customer service to be unable to effectively meet the user requirements, and the question and answer sentences generated by the intelligent customer service when marketing recommendation are prone to phenomena such as repeated language techniques, which causes excessive marketing recommendation, and thus the user experience is poor.
[0062] In view of this, the embodiments of the present disclosure provide a customer service question and answer sentence generation method, a customer service system, equipment and a medium, which generate customer service answer sentences with double goals of question and answer service and recommendation through interaction and cooperation between intelligent agents of different roles. A planning intelligent agent determines a target question and answer intelligent agent for processing a target question from different question and answer intelligent agents according to a question type corresponding to the target question and function description information corresponding to the plurality of question and answer intelligent agents; a question and answer intelligent agent generates question and answer data in a targeted manner, which ensures the data accuracy of the question and answer data; and the planning intelligent agent further confirms whether recommendation service needs to be performed according to the question and answer data generated by the question and answer intelligent agent and a preset question and answer strategy. Only in the case where the recommendation service needs to be performed, the recommendation data corresponding to the target question is generated based on a recommendation intelligent agent, which avoids mechanical marketing recommendation after answering the user's question. Finally, a summary intelligent agent summarizes the question and answer data and the recommendation data generated, and generates the final customer service question and answer sentence, which improves the generation effect of the customer service question and answer sentence in the question and answer service and recommendation scene.
[0063] In a first aspect, the embodiments of the present disclosure provide a method for generating a customer service question and answer sentence. Figure 1 FIG. 1 is a flowchart of a method for generating a customer service question and answer sentence according to an embodiment of the present disclosure. Figure 1 The method comprises the following steps.
[0064] In step S110, based on a planning agent, a target question and answer agent for processing a target question is determined from a plurality of question and answer agents according to a question type corresponding to the target question and function description information corresponding to the plurality of question and answer agents.
[0065] The target question is a consultation question raised by a user in a conversation process.
[0066] The planning agent is used for overall planning of a question and answer service and a recommendation service, including selecting a question and answer agent to process the target question to provide the question and answer service, and determining whether to provide a preset recommendation service based on a recommendation agent.
[0067] Each question and answer agent corresponds to a question type, and is used for generating answer data of a question corresponding to the question type.
[0068] Specifically, the question type can include a query type question and a knowledge type question, and the embodiments of the present disclosure do not limit the question type, and correspondingly, there is a question and answer agent for each question type to generate a question of the question type.
[0069] In an optional implementation, the question and answer agent includes a query type agent corresponding to the query type question and a knowledge type agent corresponding to the knowledge type question.
[0070] Further, the target question can be input into the planning agent, so that the planning agent determines a question type corresponding to the target question according to a question intention of the target question. For example, when the target question corresponds to a query intention of product inventory query, price consultation, discount information consultation, etc., it is determined that the question type corresponding to the target question is the query type question. When the target question corresponds to a question and answer intention of knowledge, it is determined that the question type corresponding to the target question is the knowledge type question.
[0071] In an optional implementation, before determining the target question and answer agent for processing the target question, the planning agent can also perform normalization processing on the target question to make the question content of the target question be expressed in a standard manner.
[0072] The normalization processing can include content filling, sequence adjustment, etc., and can be implemented by the planning agent based on a Chain of Thought (CoT) method.
[0073] The function description information corresponding to the question and answer agent is used to describe the function characteristics of the question type corresponding to the question and answer agent capable of processing the question.
[0074] Accordingly, the task prompt information input planning agent can be constructed according to the target question, the function description information corresponding to the plurality of question and answer agents, and the task description information, so that the planning agent determines the question type of the target question, and determines the target question and answer agent for processing the target question from the plurality of question and answer agents according to the question type corresponding to the target question and the function description information corresponding to the plurality of question and answer agents.
[0075] It should be noted that the planning agent and the question and answer agent can be constructed based on an existing large language model (LLM), and the present disclosure does not limit this.
[0076] Step S120: generating the question answer data corresponding to the target question based on the target question and answer agent processing the target question.
[0077] The question answer data corresponding to the target question refers to the answer content output by the target question and answer agent for answering the target question.
[0078] In an optional implementation, in the case where the target question and answer agent is a query type agent, a preset query interface can be used, so that the target question and answer agent selects a corresponding preset query interface according to the target question, and generates the question answer data corresponding to the target question.
[0079] Accordingly, based on the target question and answer agent processing the target question, the question answer data corresponding to the target question is generated, including: inputting the target question and a plurality of interface description information corresponding to a plurality of preset query interfaces into the query type agent, so that the query type agent selects a target query interface corresponding to the target question from the plurality of preset query interfaces according to the plurality of interface description information, and generates parameter information corresponding to the target query interface according to the target question; matching the parameter information with a preset parameter word, updating the parameter information according to the matching result; running the target query interface according to the updated parameter information, and generating the question answer data corresponding to the target question according to the running result of the target query interface.
[0080] Each preset query interface is used to implement a query function, and the query functions implemented by different preset query interfaces are all different. Each preset query interface has corresponding parameters, and the parameters are determined according to the query function corresponding to the preset query interface.
[0081] The interface description information includes interface function description information and interface parameter description information. The interface function description information is used to describe the query function corresponding to the query interface, and the interface parameter description information is used to describe the parameter meaning corresponding to the query interface.
[0082] For example, the preset query interface can include a product inventory query interface, a price query interface, a preferential activity query interface, and the like, and the corresponding query functions thereof are to query product inventory, query price, and query preferential activity, respectively.
[0083] Thus, the function and parameter meaning of each preset query interface can be described in detail through the interface description information.
[0084] Correspondingly, the query type intelligent agent can select a target query interface corresponding to the target question from the plurality of preset query interfaces according to the target question and the plurality of interface description information, and convert the target question into parameter information corresponding to the target query interface.
[0085] For example, when the target question is "Is there inventory for the white A model electronic product?", the corresponding target query interface can be the product inventory query interface, and the target question can be converted into parameter information corresponding to the query interface, such as a color parameter: white, and a model parameter: A model.
[0086] It should be noted that, in the process of converting the target question into parameter information, the parameter information parsed can be incorrect due to errors in the expression of the target question, and therefore, the parameter information needs to be matched with preset parameter terms, so as to update the parameter information according to the matching result.
[0087] The preset parameter terms refer to standard parameter terms used to represent product names, attributes, and types, and through the preset parameter terms, valid query results can be queried in the database when the preset query interface is called.
[0088] In the embodiments of the present disclosure, the query type intelligent agent is used to construct a preset query interface based on a business scenario, to generate a question and answer statement corresponding to a dynamic query type question in a user session, and to improve the generation effect of the question and answer statement under a query type question.
[0089] In an optional implementation manner, to improve the matching effect of the parameter information and the preset parameter terms, matching the parameter information with the preset parameter terms includes: extracting a first preset parameter term corresponding to a parameter type matched with the parameter information from product sample information, matching the parameter information with the first preset parameter term to obtain a first matching result; performing regular matching of the parameter information with a second preset parameter term in a preset parameter term library to obtain a second matching result; and obtaining a matching result according to the first matching result and the second matching result.
[0090] The product sample information refers to product description information corresponding to a product sample. Since there are many product categories, a preset number of popular product information can be selected as the product sample information from a plurality of preset product information each time, and a first preset parameter term included in the product sample information is matched with the parameter information.
[0091] The parameter information corresponds to a parameter type, which is used to represent product information or product characteristics. For example, the parameter type can be a product name, a product attribute, a product type, etc.
[0092] Accordingly, the first matching result can include the first preset parameter term related to the parameter information.
[0093] The preset parameter library includes second preset parameter terms corresponding to different parameter types, which are preset according to a product standard name alias term table.
[0094] By performing regular matching between the parameter information and the second preset parameter terms in the preset parameter library, a second matching result is obtained, which can filter out the second preset parameter terms related to the parameter information.
[0095] Finally, according to the first matching result and the second matching result, the most relevant preset parameter term to the parameter information can be selected as the final matching result according to the first matching result and the second matching result, or the preset parameter terms included in the first matching result and the second matching result can be sorted according to relevance, thereby generating a preset parameter term sequence, and the preset parameter term sequence is taken as the matching result.
[0096] In the embodiments of the present disclosure, considering that the parameter information may have a misrepresentation, the product sample information corresponding to the product with a high heat value and the standard preset parameter library are combined to extract the preset parameter term matching the parameter information, which facilitates the standardization of the parameter information with an irregular format and ensures the stability of the query process.
[0097] In an optional implementation, to improve the accuracy of updating the parameter information, the parameter information is updated according to the matching result, including: selecting a target parameter term with the highest similarity to the parameter information from the preset parameter terms according to the matching result, and updating the parameter information according to the target parameter term.
[0098] The matching result represents the preset parameter term matching the parameter information and the matching similarity between the parameter information and the preset parameter term.
[0099] After obtaining the updated parameter information, the target query interface can be run by the query type agent according to the updated parameter information, so as to generate the problem answer data corresponding to the target question according to the running result of the target query interface.
[0100] Specifically, a code parser is arranged in the query type agent, which is used to perform product comparison, price sorting, time calculation and other query functions corresponding to the preset query interface, so as to obtain the running result of the target query interface.
[0101] It should be noted that in the case that the running result of the target query interface is empty, the parameter information can be updated again according to the matching result, and the target query interface can be run according to the updated parameter information, which is not limited by the embodiments of the present disclosure.
[0102] In an optional implementation, in the case that the target question and answer agent is a knowledge type agent, in order to improve the accuracy of the generation of the problem answer data by the knowledge type agent, the target question can be subjected to keyword extraction, so as to retrieve the knowledge fragments according to the extracted keywords, and generate the problem answer data according to the retrieved knowledge fragments.
[0103] Correspondingly, in the case that the target question and answer agent is a knowledge type agent, the target question and answer agent is used to process the target question and generate the problem answer data corresponding to the target question, which includes: dividing the preset document knowledge data into multiple data fragments; extracting a target keyword from the target question, generating an associated keyword having an associated relationship with the target keyword according to the semantic of the target keyword, and taking the target keyword and the associated keyword as retrieval keywords; retrieving a target data fragment corresponding to the retrieval keywords from the multiple data fragments according to the retrieval keywords; and inputting the target question and the target data fragment into the knowledge type agent, so that the knowledge type agent generates the problem answer data corresponding to the target question according to the target data fragment.
[0104] The preset document knowledge data is professional knowledge document data corresponding to a preset business scenario field. When the preset document knowledge data is divided, the preset document knowledge data can be divided according to a preset data length, so as to obtain multiple data fragments corresponding to the preset document knowledge data.
[0105] The target keyword refers to a key word or phrase that can represent the content and subject of the target question.
[0106] By extracting the target keyword from the target question, the multiple data fragments corresponding to the preset document knowledge data can be retrieved according to the target keyword, so as to filter out the target data fragment corresponding to the keyword, and the data fragment contains the knowledge data corresponding to the target question.
[0107] It should be noted that, since the target keyword may have inaccurate expression problem, after the target keyword is extracted, the associated keyword having the association relationship with the target keyword can be generated according to the word semantics of the target keyword, for example, the target keyword is matched with the knowledge words contained in the preset knowledge library, so as to select the knowledge words having semantic similarity with the target keyword as the associated keyword.
[0108] The associated keyword is the supplementary keyword corresponding to the target keyword. Therefore, when retrieving the knowledge fragment, the target keyword and the associated keyword can be used as the retrieval keyword to filter out the target data fragment, thereby improving the filtering effectiveness and reliability of the target data fragment.
[0109] After the target data fragment is filtered out, the target question and the target data fragment are input into the knowledge type agent, so that the knowledge type agent can generate the question answering data corresponding to the target question according to the content of the target data fragment.
[0110] It should be noted that, in order to improve the reliability of generating the question answering data, in an optional implementation manner, the target question, the target data fragment and the data generation requirement are input into the knowledge type agent, so that the knowledge type agent generates the question answering data according to the target data fragment under the condition that the target data fragment is related to the target question.
[0111] Therefore, the error question answering data is avoided to be generated under the condition that the filtered target data fragment is irrelevant to the target question.
[0112] Correspondingly, under the condition that the filtered target data fragment is irrelevant to the target question, the knowledge type agent can output empty data to represent that the target data fragment is irrelevant to the target data.
[0113] Step S130: determining whether to execute the preset recommendation service based on the planning agent according to the target question, the question answering data corresponding to the target question and the preset question answering strategy, and generating the recommendation data corresponding to the target question based on the recommendation agent under the condition that it is determined to execute the preset recommendation service.
[0114] The preset question answering strategy refers to the answering strategy preset for different questions, which includes question answering skills, question answering tactics and other strategy contents. For example, when the user's question expresses concern about product quality, the question should be understood first, then explained according to the product formal qualification description, and finally the return guarantee information is introduced.
[0115] Correspondingly, the preset question and answer strategy can be generated by data mining on historical dialogue data and / or a sop process specification based on business experience.
[0116] Therefore, by inputting the target question, the question answering data corresponding to the target question, and the preset question and answer strategy into the planning agent, the planning agent can determine whether to perform the preset recommendation service by referring to the preset question and answer strategy.
[0117] For example, the preset question and answer strategy includes a preset question and a question and answer process corresponding to the preset question. Therefore, the planning agent finds the corresponding question and answer process in the preset question and answer strategy according to the target question and the question answering data corresponding to the target question. In the case where the question and answer process includes a recommendation process, it is determined to perform the preset recommendation service.
[0118] For example, for a product inventory consultation question, the preset question and answer strategy specifies that relevant product recommendations are made in the case of no inventory. Therefore, the planning agent can determine to perform the preset recommendation service in the case of no inventory corresponding to the question answering data of the product inventory consultation question.
[0119] The recommendation agent is configured to mine user demand and generate corresponding recommendation data. The recommendation data can be product description content, product purchase link, and other recommendation script information, which is not limited in the embodiments of the present disclosure.
[0120] Therefore, in the case of determining to perform the preset recommendation service, the recommendation data corresponding to the target question can be generated based on the recommendation agent.
[0121] Step S140: Based on the summary agent, generating a customer service question and answer sentence corresponding to the target question according to the question answering data and the recommendation data.
[0122] The summary agent is configured to perform script summarization and data post-processing on the data generated by the target question and answer agent and the recommendation agent.
[0123] Specifically, the script generation requirements and the preset business rules can be input into the summary agent, so that the customer service question and answer sentence output by the summary agent according to the question answering data and the recommendation data is standardized and compliant.
[0124] In addition, in the case where the recommendation agent does not need to generate recommendation data, the summary agent can generate a customer service question and answer sentence only according to the question answering data, which is not limited in the embodiments of the present disclosure.
[0125] It should be noted that the above-mentioned agents in the embodiments of the present disclosure can be constructed according to a large language model LLM, which is not limited in the embodiments of the present disclosure.
[0126] In the embodiments of the present disclosure, the intelligent agents with different roles interact and cooperate with each other, so as to generate a customer service answer statement with both question and answer service and recommendation dual goals according to the interaction result. The planning agent determines a target question and answer agent for processing the target question from different question and answer agents according to the question type corresponding to the target question and the function description information of the plurality of question and answer agents. The question and answer agent generates question and answer data in a targeted manner, ensuring the data accuracy of the question and answer data. In addition, the planning agent further confirms whether the recommendation service needs to be performed according to the question and answer data generated by the question and answer agent and the preset question and answer strategy. Only in the case where the recommendation service needs to be performed, the recommendation data corresponding to the target question is generated based on the recommendation agent, avoiding mechanical marketing recommendation after answering the user's question. Finally, the summary agent summarizes the question and answer data and the recommendation data generated to generate the final customer service question and answer statement, improving the generation effect of the customer service question and answer statement in the question and answer service and recommendation scenarios.
[0127] In addition, those skilled in the art can also make various modifications and variations to the method in the present disclosure:
[0128] In an optional implementation, in order to improve the recommendation effect of the recommendation data generated by the recommendation agent, the target recommendation case data can be selected from the preset recommendation case data according to the associated dialogue data corresponding to the target question, so that the recommendation agent generates the recommendation data according to the target recommendation case data.
[0129] Correspondingly, the recommendation data corresponding to the target question is generated based on the recommendation agent, including: obtaining associated dialogue data corresponding to the target question from historical dialogue data; performing vector matching on the associated dialogue data and a plurality of preset recommendation case data, and selecting target recommendation case data corresponding to the associated dialogue data according to the vector matching result; generating prompt information according to the target recommendation case data and a preset answer strategy, and inputting the prompt information into the recommendation agent, so that the recommendation agent generates the recommendation data corresponding to the target question according to the prompt information.
[0130] The historical dialogue data refers to the context dialogue data in the historical time. The associated dialogue data corresponding to the target question refers to the historical dialogue data related to the target question.
[0131] For example, the target question and the associated dialogue data corresponding to the target question include the first N rounds of dialogue data or the first N dialogue sentences of the target question, where N is a natural number, and the embodiments of the present disclosure do not limit the same.
[0132] Since the target question raised by the user may have the problem of incomplete information, the associated dialogue data corresponding to the target question is extracted, so as to reflect the actual intention of the user and the historical dialogue process between the user and the intelligent customer service in the associated dialogue data.
[0133] The preset recommendation case data refers to a preset recommendation case template, which can include recommendation case dialogues, processes, and the like.
[0134] Specifically, the preset recommendation case data can be stored in a vector database, so that when it is necessary to generate recommendation data, target recommendation case data similar to the associated dialogue data can be selected from the vector matching of the associated dialogue data and the plurality of preset recommendation case data.
[0135] Further, the target recommendation case data and the preset answer strategy are used to generate prompt information, and the prompt information is input into the recommendation agent, so that the recommendation agent can refer to the target recommendation case data and the preset answer strategy to generate the recommendation data.
[0136] It should be noted that the prompt information can also include the target question, question answer data corresponding to the target question, associated dialogue data, and the like, which are not limited in the embodiments of the present disclosure.
[0137] In the embodiments of the present disclosure, an independent recommendation agent is used, and the preset question and answer strategy summarized by business experience and offline data mining and the target recommendation case data corresponding to the associated dialogue data corresponding to the target question in the preset recommendation case data are used to jointly construct the prompt information, so that the recommendation data is generated according to the preset answer strategy and the target recommendation case data, and the corresponding question and answer strategy is used according to different dialogue situations to make product recommendations, thereby solving the problem that the traditional recommendation sentence only has simple recommendation rhetoric, lacks recommendation strategy, recommendation timing selection, and insight into user demand, and the recommendation effect is not good.
[0138] In an optional implementation manner, in order to improve the generation effect of the preset question and answer strategy and the preset recommendation case data, the preset question and answer strategy and the preset recommendation case data can be generated by data mining from historical dialogue data.
[0139] Correspondingly, the preset question and answer strategy and the preset recommendation case data are generated in the following manner: information extraction is performed on each dialogue data in the historical dialogue data to obtain a question and answer strategy corresponding to the dialogue data and a dialogue result corresponding to the dialogue data; the number of positive samples and the number of negative samples corresponding to the question and answer strategy are determined according to the dialogue results corresponding to the plurality of dialogue data corresponding to the same question and answer strategy; the strategy effectiveness of the question and answer strategy is calculated according to the number of positive samples and the number of negative samples corresponding to the question and answer strategy; in the case where the strategy effectiveness is higher than a preset threshold, the question and answer strategy is taken as a preset question and answer strategy, and the preset recommendation case data is generated according to the dialogue data corresponding to the question and answer strategy.
[0140] Each of the historical dialogue data is a complete dialogue data between the user and the intelligent customer service.
[0141] The question and answer strategy corresponding to the dialogue data refers to the dialogue process, the dialogue content and the like extracted from the dialogue data. The dialogue result corresponding to the dialogue data includes a service evaluation of the user on the intelligent customer service and / or a product conversion situation.
[0142] The number of positive samples corresponding to the question and answer strategy refers to the number of dialogue data with a product conversion success and / or a service evaluation reaching a preset evaluation value. The number of negative samples corresponding to the question and answer strategy refers to the number of dialogue data with a product conversion failure and / or a service evaluation not reaching a preset evaluation value.
[0143] The strategy effectiveness degree is used to represent the strategy execution effect of the question and answer strategy. The higher the strategy effectiveness degree is, the more effective the question and answer strategy is.
[0144] Therefore, according to the number of positive samples and the number of negative samples corresponding to the question and answer strategy, the strategy effectiveness degree of the question and answer strategy can be calculated. For example, the ratio between the number of positive samples and the total number of samples corresponding to the number of positive samples and the number of negative samples is calculated to obtain the strategy effectiveness degree.
[0145] Correspondingly, in the case where the strategy effectiveness degree is higher than a preset threshold, the question and answer strategy can be used as a preset question and answer strategy. According to the dialogue data corresponding to the question and answer strategy, preset recommended case data is generated.
[0146] Exemplarily, the dialogue data corresponding to the question and answer strategy can be extracted as key dialogue data, so that the preset recommended case data is generated according to the key dialogue data.
[0147] In the embodiments of the present disclosure, by performing data mining on the historical dialogue data according to the evaluation feedback of the user and the product conversion situation, the preset question and answer strategy and the preset recommended case data are generated, which improves the data effectiveness of the preset question and answer strategy and the preset recommended case data, thereby helping to improve the judgment accuracy of the planning agent in executing the preset recommended service according to the preset question and answer strategy and the data effect of the recommended agent in generating the recommended data.
[0148] In an optional implementation manner, in order to improve the generation effect of the summary agent on the customer question and answer sentences, the summary agent can be trained according to the preset question and the question and answer sentence of the preset dialogue style corresponding to the preset question, so that the summary agent can generate the customer question and answer sentence of the preset dialogue style according to the question and answer data and the recommended data.
[0149] Correspondingly, the summary agent is trained according to pre-set questions and pre-set question-answer statements corresponding to pre-set question styles, and based on the summary agent, a target question-answer statement corresponding to a target question is generated based on question-answer data and recommendation data, including: performing data filling processing and / or redundant data filtering processing on the question-answer data and the recommendation data; inputting the processed question-answer data and the recommendation data into the summary agent, so that the summary agent generates a customer service question-answer statement corresponding to the target question according to the pre-set question style.
[0150] The pre-set question style refers to the language expression mode of the statement. Under different customer service roles, the corresponding question style may be different, so the pre-set question-answer statements corresponding to the pre-set question style for the pre-set question can be collected, and the summary agent can be obtained by fine-tuning the large language model according to the pre-set question and the question-answer statement.
[0151] The data filling processing on the question-answer data and the recommendation data refers to supplementing missing data in the question-answer data and the recommendation data, such as missing product names, so as to improve the completeness of the generated customer service question-answer statement.
[0152] In an optional implementation, the data filling processing on the question-answer data and the recommendation data includes: determining whether there is missing data to be filled in the question-answer data and the recommendation data based on the summary agent, determining the data type of the missing data; extracting target filling data corresponding to the data type from the associated dialogue data corresponding to the target question; and performing data filling processing on the question-answer data and the recommendation data based on the target filling data.
[0153] Specifically, the question-answer data and the recommendation data can be input into the summary agent to determine whether there is missing data to be filled in the question-answer data and the recommendation data, such as missing product names, product types, etc.
[0154] Accordingly, the target filling data corresponding to the data type is extracted from the associated dialogue data corresponding to the target question according to the data type of the missing data, and the data filling processing is performed based on the target filling data.
[0155] For example, for a target question "How much is the remaining inventory of product A", the question-answer data is remaining inventory: 10, so the summary agent can determine that the question-answer data has missing product name, and then obtain the target filling data, i.e. product name "product A", from the associated data, and then fill the target filling data into the question-answer data.
[0156] In the embodiments of the present disclosure, the missing key information such as product name in the question answering data and recommendation data is completed using the associated dialogue data corresponding to the target question, so as to ensure the completeness of the generated customer service question and answer sentences.
[0157] In the embodiments of the present disclosure, the redundant data filtering processing of the question answering data and the recommendation data refers to filtering the redundant information corresponding to the agent explanation content in the question answering data and the recommendation data.
[0158] Specifically, the redundant data filtering processing of the question answering data and the recommendation data can be directly performed by the summarization agent, or a redundant filtering rule can be set, and the data filtering processing is performed based on the redundant filtering rule, and the embodiments of the present disclosure do not limit this.
[0159] Correspondingly, after the processed question answering data and recommendation data are input into the summarization agent, since the summarization agent is trained according to the question and answer sentences corresponding to the preset dialogue style, the summarization agent can generate the customer service question and answer sentences of the preset dialogue style according to the processed question answering data and recommendation data.
[0160] In the embodiments of the present disclosure, the data filling and the data filtering processing are performed on the question answering data and the recommendation data, so as to generate the customer service question and answer sentences according to the processed data, which improves the generation accuracy of the customer service question and answer sentences, and since the summarization agent is trained according to the question and answer sentences of the preset dialogue style, the generated customer service question and answer sentences also maintain the same preset dialogue style, and the dialogue mechanical problem is solved.
[0161] In an optional implementation manner, in order to improve the generation accuracy of the customer service question and answer sentences, the above method further includes: for any agent, determining a verification rule corresponding to the agent according to an agent type corresponding to the agent; for any agent, verifying the output data of the agent according to the verification rule corresponding to the agent, and determining whether the output data is abnormal data, and in a case where the output data is determined to be abnormal data, instructing the agent to update the output data; in a case where the number of times of updating the output data reaches a preset number threshold, sending question clarification information to a client to confirm the target question.
[0162] Different verification rules correspond to different agent types, and the specific verification rules can be adaptively set according to the application scene needs, and the embodiments of the present disclosure do not limit this.
[0163] For example, for the question and answer agent such as the query type agent or the knowledge type agent, the verification rule can be set as determining that the question answering data of the output is abnormal data in a case where the output is empty data.
[0164] For example, for summarizing an agent, the verification rule can be set to determine that the output customer service question and answer statement is abnormal data if the generated customer service question and answer statement contains preset non-standard language.
[0165] Therefore, in the case of determining that the output data is abnormal data, the agent is instructed to update the output data, and in the case that the number of times of updating the output data reaches a preset number threshold, the problem clarification information is sent to make the user confirm the accuracy of the target problem.
[0166] It should be noted that the verification instruction can be set to enable the agent to automatically verify the output data according to the preset verification rule in the verification instruction, and in the case of verifying abnormal data, the output data is regenerated.
[0167] In the embodiments of the present disclosure, by adding a verification and correction function to the agent, the output data of the agent is verified, so that in the case of verification exception, the agent regenerates the output data, and when the number of times of regeneration reaches a preset number threshold, the problem is clarified to ensure the accuracy of the target problem.
[0168] For ease of understanding, the specific implementation details of the above embodiments are described below with a specific example.
[0169] The professional terms in the following examples are explained as follows:
[0170] (1) Large model agent: an agent built on a large language model (LLM), which has the ability to perceive user information, autonomous understanding, decision making and action execution and return response. Large model agent can simulate independent thinking process. Large model agent is composed of four key parts: planning, memory, tool and action, which are responsible for task decomposition and strategy evaluation, information storage and recall, environment perception and decision assistance, and conversion of thinking into actual action.
[0171] (2) Planning agent: planning is the thinking model of the agent, which is responsible for decomposing the user's complex task into executable subtasks and constructing execution strategy according to the preset target.
[0172] (3) Agent memory function: memory is information storage and recall, including short-term memory and long-term memory. Short-term memory is used to store the context of the current user session, which can support multi-round dialogue capability; long-term memory stores knowledge data, excellent dialogue case data, etc., which is usually realized by vector database technology for fast access.
[0173] (4) Tool agent: tool is an auxiliary means for agent to execute decision, which can expand the ability of agent by accessing tools, such as product discount information query, product sales statistics, etc.
[0174] (5) Agent action function: Action is the process of transforming planning and memory into specific output by Agent, including intelligent customer service replying to users, calling tools to the external environment, etc.
[0175] (6) Multi-Agent: Multi-Agent gives different roles to different Agents, such as overall planning Agent, question and answer Agent, recommendation Agent, etc. Through the cooperation between Agents, complex tasks with multiple goals can be completed.
[0176] (7) RAG: Retrieval-Augmented Generation is a technology that combines information retrieval technology and large model generation. It retrieves relevant information from the product / service knowledge base and inputs it as a prompt to the large model to enhance the model's ability to handle product / service strong knowledge tasks. Through optimizing the output of the large language model, it overcomes its shortcomings in handling product domain professional knowledge. RAG accesses the internal knowledge base of products / services without retraining the model, so that it can maintain relevance, accuracy and timeliness in the intelligent customer service scenario.
[0177] (8) CoT (Chain of Thought): refers to a series of intermediate reasoning steps, aiming to improve the performance of large models on complex reasoning tasks. For complex user questions, especially when multiple retrievals of knowledge base or tool calls are required, it is difficult for large models to give correct answers. CoT enhances the reasoning ability of large models for complex problems by requiring the model to output intermediate reasoning steps before outputting the final answer.
[0178] (9) In-Context Learning: is a special ability exhibited by large language models, which can learn what to do for a task by being shown a few relevant examples. This allows the model to rely on examples and prompts in the context to guide the model to reason without explicit training.
[0179] In the 3C (Computer, Communication, Consumer Electronics) e-commerce customer service dialogue scene, it is necessary for the intelligent customer service to generate question and answer sentences to communicate with potential purchasing users. While answering the user's purchase questions, the user is actively guided to place an order for the product. Due to the complexity and diversity of the questions raised by the user, which is manifested in the following aspects: colloquial description, omission of said information, alias, misspelling, interference noise information, sentence repetition, multiple question knowledge involving the question and answer library, and the need for reasoning for the answer to the question, the conventional matching method with the question and answer library cannot meet the user's needs.
[0180] At the same time, the user's intention changes are also very diverse, and it is difficult to cope with all dialogue scenarios using the traditional flow canvas configuration. Moreover, in the marketing recommendation scene, only by using the Prompt marketing rhetoric instruction method to generate question and answer sentences, it is easy to cause excessive marketing problems such as rhetoric repetition and rhetoric oppression. In addition, in the marketing recommendation process of the intelligent customer service, the ability to select the marketing opportunity and actively understand the user's demand is insufficient, resulting in poor user experience.
[0181] In addition, part of the rhetoric and knowledge in the customer service business scene has strict requirements and specifications, which need to be followed by the intelligent customer service system.
[0182] Specifically, the existing customer service question and answer sentence generation method has the following problems:
[0183] (1) Semantic understanding problem: for the user's diverse, context-related and non-standard expression form, using semantic vector representation model or directly using large model understanding ability is not enough, resulting in inaccurate understanding of the user's demand, and poor effect of generating question and answer sentences;
[0184] (2) Semantic similarity matching problem: the semantic similarity calculation of the user's question and the knowledge base question is not accurate, which leads to the matching of the wrong question and answer QA pair or the similarity score being insufficient to reach the threshold due to the large difference in expression with the same meaning, and the generation of accurate question and answer sentences is impossible;
[0185] (3) Fixed FAQ problem: limited by FAQ, only standard question and answer sentences can be provided, and the user experience is poor because the answers are mechanical;
[0186] (4) Complex problem: the user's question involves multiple FAQs, or reasoning is needed to generate question and answer sentences;
[0187] (5) Complex task processing problem: limited by the dialogue configuration of the logic flow canvas, it is impossible to generate comprehensive question and answer sentences to cope with complex and diverse user questions. Moreover, the processing of multiple rounds of dialogue often falls into a mechanical cycle;
[0188] (6) Dynamic query type problem: For some real-time query system type problems (such as checking inventory, checking different store discount activities, whether it can be delivered at the current time point, etc.), the intelligent customer service needs to have the ability to call tools for query;
[0189] (7) Marketing lacks strategy problem: The effect of generating question and answer statements according to instructions by Prompt marketing rhetoric is not good, and only simple marketing rhetoric can be included in the question and answer statements, lacking high-level marketing strategies such as marketing opportunity selection and active insight into user demand;
[0190] (8) Lack of overall planning of service and marketing: Using retrieval enhancement to generate RAG answers to user doubts for service and guiding marketing through marketing role setting can easily cause the phenomenon of rhetoric repetition and rhetoric oppression in question and answer statements, resulting in poor marketing effect.
[0191] Therefore, in this example, a method for generating customer question and answer statements is proposed:
[0192] (1) Using a planning agent to plan the service and marketing in the conversation process, thereby solving the problem of lack of marketing recommendation target and excessive marketing and repeated marketing caused by mechanically marketing recommendation after answering user questions.
[0193] (2) Using an independent recommendation agent, using marketing strategies, skills, rhetoric and similar samples recalled from preset recommendation case data as In-context Learning context learning instances, solving the problem that traditional intelligent customer service can only generate simple marketing recommendation rhetoric, lacking marketing strategies, and lacking marketing opportunity selection and insight into user demand for marketing recommendation.
[0194] (3) Using question and answer agents such as query type agents and constructing preset query interface API based on business scenarios to answer dynamic query type problems in user conversations, greatly increasing the practicality of intelligent customer service.
[0195] (4) Using a summary agent to summarize the output of the question and answer agent and the recommendation agent, and fine-tuning the large model through artificial customer service dialogue data to obtain the summary agent, so that the generated customer question and answer statements are aligned with the artificial conversation style. At the same time, by adding rhetoric requirements and following rules in the summary agent to ensure the standardization of customer question and answer data, and by adding error correction and fault tolerance mechanisms to ensure effective collaboration between intelligent agents.
[0196] (5) Use multi-agent to assist in completing the conversation process, and give different roles to different agents. Through the cooperation between multiple agents, the goal of question and answer service and marketing recommendation is completed. The problems of complex task processing difficulty, low conversation process configuration coverage, processing machinery, lack of intelligence, semantic understanding difficulty caused by non-standard user expression, poor effect of generated customer service question and answer sentences, and the problems of one-step decision, lack of overall planning and easy to fall into a dead loop when generating customer service question and answer sentences caused by using single agent as service and marketing agent are solved.
[0197] Figure 2 For the schematic diagram of the customer service question and answer sentence generation method proposed in this example, refer to Figure 2 The method comprises the following steps:
[0198] Step S201: Based on the planning agent, according to the problem type corresponding to the target problem and the function description information corresponding to the plurality of question and answer agents, a target question and answer agent for processing the target problem is determined from the plurality of question and answer agents.
[0199] Specifically, Figure 3 For the application schematic diagram of each agent in this example, refer to Figure 3 For the target problem proposed by the user, the planning agent rewrites the target problem in CoT, generates a more standardized and complete target problem, and helps the model better understand and plan the task.
[0200] In addition, the data cleaning of wrong characters, stacked words and non-standard characters in the target problem can also be performed in a regular manner.
[0201] Correspondingly, after the planning agent understands the problem intention of the user's target problem, it will guide the entire question and answer sentence generation process and interact with other agents in the process.
[0202] The planning agent will plan according to the preset prompts, such as the function description information corresponding to the plurality of question and answer agents, so as to determine the target question and answer agent for processing the target problem from the plurality of question and answer agents, such as the query type agent and the knowledge type agent.
[0203] Step S202: Based on the target question and answer agent, the problem answer data corresponding to the target problem is generated.
[0204] Specifically, refer to Figure 3 When the planning agent determines that there is a dynamic query type task such as product inventory query, price consultation, and preferential information consultation, the query type agent will be called, and this agent is a tool execution agent.
[0205] The query type agent has the functions of calling preset query interface API and code parser, and is responsible for executing specific query tasks. The input thereof is a target question, interface description information of all preset query interface APIs such as detailed function description and detailed parameter description, and then the query type agent can output a target query interface to be called, and convert the target question into parameter information to be passed to the target query interface. After that, a code parser is constructed for query functions such as product discount comparison, price sorting and time calculation, the target query interface is executed, and the result is returned.
[0206] In the process of converting the target question into parameter information corresponding to the target query interface, an API parsing plug-in is added, and the API parsing plug-in is called if the parameter parsing is incorrect. After completing the target question parsing and API selection, the parameter information such as product name, attribute and type is corrected by combining few-shot large model extraction based on 3C digital product samples and regular extraction of 3C digital product standard name alias tables, and the parameters in non-standard format are standardized to ensure the stability of the query process.
[0207] When the planning agent determines that there is a professional knowledge question and answer task, the knowledge type agent is called to perform RAG based on preset document knowledge data. The knowledge type agent answers the target question according to the preset document knowledge data, the input thereof is the target question and the preset document knowledge data, in the execution process, the preset document knowledge data is divided into fragments, and the target keywords are extracted from the target question, so that the target data fragments are retrieved based on the target keywords, so that the large model answers the target question based on the target data fragments, and in the answering process, it is required that the answer must strictly follow the document content, even if it is inconsistent with the fact, if it is irrelevant, do not answer, and finally output the question answering data.
[0208] In addition, the QA pairs can be extracted from the preset document knowledge data or the knowledge graph can be constructed, so that the vector database storing the QA pairs is created or the knowledge graph is entity clustered by using hierarchical clustering. Finally, the question answering data is generated by performing semantic similarity retrieval or entity traversal query on the target question.
[0209] Step S203: Based on the planning agent, whether to perform a preset recommended service is determined according to the target question, question answering data corresponding to the target question and a preset question and answer strategy.
[0210] Reference Figure 3 After the query type agent or the knowledge type agent is executed, the generated question answering data is returned to the planning agent, and the planning agent determines whether to perform a preset service according to a preset answering strategy, such as a business experience SOP process specification and an answering strategy based on historical dialogue data mining.
[0211] Step S204: In the case of determining to perform the preset recommendation service, the associated dialogue data corresponding to the target question is obtained from the historical dialogue data.
[0212] Referring to Figure 3 If the planning agent determines that the preset recommendation service needs to be performed, the recommendation agent is called to perform marketing recommendation. The recommendation agent can further mine user demand and decide which marketing recommendation method to use according to the current demand and intention of the user. The recommendation agent generates recommendation data through a preset question and answer strategy and preset recommendation case data to guide the user to purchase and convert the product.
[0213] Among them, the associated dialogue data is the contextual dialogue data between the current user and the intelligent customer service.
[0214] Step S205: The associated dialogue data is vector matched with the plurality of preset recommendation case data, and the target recommendation case data corresponding to the associated dialogue data is selected according to the vector matching result.
[0215] Referring to Figure 3 The preset recommendation case data is an excellent marketing dialogue case mined from historical dialogue data, and more preset recommendation case data can be supplemented according to real-time feedback of the user and product conversion. Further, the preset recommendation case data can be vectorized using a vector representation model and stored in a vector database.
[0216] In this step, the input target question and the preset recommendation case data are vector indexed to retrieve target recommendation case data similar to the current associated dialogue data, and preset recommendation case data with inconsistent product types is filtered.
[0217] Step S206: The prompt information is generated according to the target recommendation case data and the preset answer strategy, and the prompt information is input into the recommendation agent to make the recommendation agent generate recommendation data corresponding to the target question according to the prompt information.
[0218] Referring to Figure 3 The target recommendation case data and the preset question and answer strategy are combined to form the prompt information Prompt, and different question and answer strategies are used according to different situations through in-context learning, and corresponding recommendation data is generated.
[0219] In addition, few-shot examples can also be constructed based on the target recommendation case data and the preset question and answer strategy as prompt information, which is not limited in this example.
[0220] In the recommendation agent of the present example, based on the preset question and answer strategy such as the sop specification marketing strategy and the associated dialogue data, i.e. the stored context dialogue data, as the thinking reasoning and decision of the Short-term auxiliary recommendation agent, the preset recommendation case data is taken as the Long-term for retrieval and learning, and the dialogue data is supplemented as the Long-term accumulated experience according to the online user's evaluation feedback and product conversion, so as to realize the iterative optimization of the recommendation ability of the recommendation agent.
[0221] Step S207: Based on the summary agent, the target question corresponding to the customer service question and answer sentence is generated according to the question and answer data and the recommendation data.
[0222] With reference to Figure 3 The data generated by the question and answer agent and the recommendation agent is transmitted into the summary agent, and the generated data is processed. The summary agent can be fine-tuned based on the real dialogue data of the preset dialogue style, so that the style of the output customer service question and answer sentence is consistent with the artificial conversation, and the dialogue mechanical problem is solved.
[0223] Moreover, the dialogue requirement and business compliance rule can be added in the summary agent to ensure the standardization and compliance of the finally output customer service question and answer sentence. The associated dialogue data, i.e. the dialogue context, is used to complete the missing key information in the recommendation data and the question and answer data, so as to ensure the completeness of the dialogue, and through filtering all the redundant information generated by the large model thinking explanation, the finally output customer service question and answer sentence is accurate and standard.
[0224] In addition, with reference to Figure 4 In order to ensure the accuracy of the output of the customer service question and answer sentence, the fault-tolerant error correction mechanism can be applied in the agent, so that the large model can reflect and optimize itself after the error occurs, such as giving the large model a similar instruction of "if the returned result is empty or wrong, please reflect and re-execute the task". The error correction fault-tolerant mechanism ensures the effective cooperation between the agents, and improves the robustness of the whole system. At the same time, if the whole process repeatedly judges that it is wrong for many rounds, the bottom-up strategy is triggered to clarify the problem and let the user confirm the question again.
[0225] Correspondingly, for the conversation between the user and the intelligent customer service, the chat history of the current conversation needs to be maintained, the target question of the user and the customer service question and answer sentence of the intelligent customer service are stored, when the user has a new input target question, it is added to the chat history, and the perception of all the information in the above text is ensured.
[0226] In the example, for the customer service question and answer statement generation in the 3C digital e-commerce scenario, the planning agent is used as the overall organizer, the query type agent and the knowledge type agent are used to solve user question service, the recommendation agent is used to focus on marketing recommendation, the summary agent is used to integrate the content to generate the customer service question and answer statement and feed back to the user, and each agent has a fault correction mechanism, which can reflect and optimize the error and regenerate the data, thereby improving the generation effect of the customer service question and answer statement with service and marketing recommendation dual goals.
[0227] The step division of the above various methods is only for clear description, and in implementation, one step can be combined or some steps can be split and decomposed into multiple steps, as long as the same logical relationship is included, and all are within the protection scope of the patent; adding irrelevant modifications or introducing irrelevant designs in the algorithm or process, but not changing the core design of the algorithm and process, are within the protection scope of the patent.
[0228] In a second aspect, the embodiments of the present disclosure provide a customer service system, Figure 5 A block diagram of a customer service system 40 provided by the embodiments of the present disclosure is shown in FIG. 4, and the customer service system 40 includes:
[0229] A planning agent 41 is configured to determine a target question and answer agent for processing a target question from a plurality of question and answer agents according to a problem type corresponding to the target question and function description information corresponding to the plurality of question and answer agents.
[0230] A question and answer agent 42 is configured to process the target question and generate problem answer data corresponding to the target question.
[0231] The planning agent 41 is further configured to determine whether to perform a preset recommendation service according to the target question, the problem answer data corresponding to the target question, and a preset question and answer strategy.
[0232] A recommendation agent 43 is configured to generate recommendation data corresponding to the target question in a case where it is determined to perform the preset recommendation service.
[0233] A summary agent 44 is configured to generate a customer service question and answer statement corresponding to the target question according to the problem answer data and the recommendation data.
[0234] In an optional implementation, the question and answer agent includes a query type agent and a knowledge type agent, and in a case where the target question and answer agent is the query type agent, the generating the problem answer data corresponding to the target question based on the target question and answer agent processing the target question includes:
[0235] input the target question, the plurality of interface description information corresponding to the plurality of preset query interfaces, and the parameter information corresponding to the target query interface into the query type agent, so that the query type agent generates question answering data corresponding to the target question according to the target data slice.
[0236] match the parameter information with preset parameter words, and update the parameter information according to a matching result;
[0237] run the target query interface according to the updated parameter information, and generate question answering data corresponding to the target question according to a running result of the target query interface.
[0238] In an optional implementation manner, the matching of the parameter information with the preset parameter words comprises:
[0239] extracting first preset parameter words matching a parameter type corresponding to the parameter information from product sample information, matching the parameter information with the first preset parameter words to obtain a first matching result;
[0240] regularly matching the parameter information with second preset parameter words in a preset parameter library to obtain a second matching result;
[0241] obtaining the matching result according to the first matching result and the second matching result.
[0242] In an optional implementation manner, in a case where the target question answering agent is the knowledge type agent, the generating of question answering data corresponding to the target question based on the target question answering agent processing the target question comprises:
[0243] sharding preset document knowledge data to obtain a plurality of data slices corresponding to the preset document knowledge data;
[0244] extracting a target keyword from the target question, generating an associated keyword having an association relationship with the target keyword according to a word semantic of the target keyword, and taking the target keyword and the associated keyword as retrieval keywords;
[0245] retrieving a target data slice corresponding to the retrieval keywords from the plurality of data slices according to the retrieval keywords;
[0246] inputting the target question and the target data slice into the knowledge type agent, so that the knowledge type agent generates question answering data corresponding to the target question according to the target data slice.
[0247] In an optional implementation, the recommendation agent is configured to generate the recommendation data corresponding to the target question, including:
[0248] obtaining, from historical dialogue data, associated dialogue data corresponding to the target question;
[0249] performing vector matching on the associated dialogue data and a plurality of preset recommendation case data, and selecting target recommendation case data corresponding to the associated dialogue data according to a vector matching result;
[0250] generating prompt information according to the target recommendation case data and the preset answer strategy, and inputting the prompt information into the recommendation agent, so that the recommendation agent generates the recommendation data corresponding to the target question according to the prompt information.
[0251] In an optional implementation, the preset question and answer strategy and the preset recommendation case data are generated in the following manner:
[0252] performing information extraction on each piece of dialogue data in historical dialogue data to obtain a question and answer strategy corresponding to the dialogue data and a dialogue result corresponding to the dialogue data;
[0253] determining a number of positive samples and a number of negative samples corresponding to the question and answer strategy according to dialogue results corresponding to a plurality of pieces of dialogue data corresponding to the question and answer strategy;
[0254] calculating a strategy effectiveness of the question and answer strategy according to the number of positive samples and the number of negative samples corresponding to the question and answer strategy;
[0255] in a case where the strategy effectiveness is higher than a preset threshold, taking the question and answer strategy as the preset question and answer strategy, and generating the preset recommendation case data according to dialogue data corresponding to the question and answer strategy.
[0256] In an optional implementation, the summary agent is trained according to a preset question and an answer sentence in a preset dialogue style corresponding to the preset question, and the generating, by the summary agent, of the customer service question and answer sentence corresponding to the target question according to the question answer data and the recommendation data includes:
[0257] performing data padding processing and / or redundant data filtering processing on the question answer data and the recommendation data;
[0258] inputting the processed question answer data and recommendation data into the summary agent, so that the summary agent generates the customer service question and answer sentence corresponding to the target question according to the preset dialogue style.
[0259] The system provided by the embodiments of the present disclosure has functions or contains modules that can be used to execute the method described in the method embodiments of the first aspect, and the specific implementation and technical effects can refer to the description of the method embodiments. For brevity, the specific steps of the method for generating customer service Q&A sentences will not be described here.
[0260] It should be noted that each module involved in the present embodiment is a logical module. In actual application, one logical unit can be one physical unit, or a part of one physical unit, or realized by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present disclosure, units not closely related to solving the technical problems proposed by the present disclosure are not introduced in the present embodiment, but this does not mean that there are no other units in the present embodiment.
[0261] With reference to The embodiments of the present disclosure provide an electronic device, which comprises:
[0262] one or more processors 501;
[0263] a memory 502, having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method for generating customer service Q&A sentences of any one of the above;
[0264] one or more I / O interfaces 503 connected between the processor and the memory, configured to realize information interaction of the processor and the memory.
[0265] The processor 501 is a device with data processing capability, including but not limited to a central processing unit (CPU) and the like; the memory 502 is a device with data storage capability, including but not limited to a random access memory (RAM, more specifically SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (FLASH); the I / O interface (read-write interface) 503 is connected between the processor 501 and the memory 502, and can realize information interaction of the processor 501 and the memory 502, including but not limited to a data bus (Bus) and the like.
[0266] In some embodiments, the processor 501, the memory 502 and the I / O interface 503 are connected with each other through a bus, and further connected with other components of the computing device.
[0267] The present embodiment also provides a computer readable medium having a computer program stored thereon, wherein the program is executed by the processor to implement the method for generating customer service Q&A sentences provided by the present embodiment. To avoid repetition, the specific steps of the method for generating customer service Q&A sentences will not be described here.
[0268] Those skilled in the art can understand that all or some of the steps in the method, the functional modules / units in the system and the device described above can be implemented by software, firmware, hardware, or a combination thereof. In the hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer-readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and can include any information delivery media.
[0269] It should be noted that the terms "comprising", "including", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0270] Those skilled in the art can understand that although some embodiments described herein include certain features included in other embodiments but not others, the combination of features of different embodiments means that it is within the scope of the embodiments and forms different embodiments.
[0271] It is understood that the above embodiments are only exemplary for illustrating the principles of the present disclosure, and the present disclosure is not limited thereto. Various modifications and improvements can be made by those of ordinary skill in the art without departing from the spirit and essence of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A method for generating a customer question and answer sentence, characterized in that, The method comprises: determining, based on a planning agent, a target question answering agent for processing a target question from a plurality of question answering agents according to a question type corresponding to the target question and function description information corresponding to the plurality of question answering agents; generating question answering data corresponding to the target question based on the target question answering agent processing the target question; determining, based on the planning agent, whether to execute a preset recommendation service according to the target question, question answering data corresponding to the target question, and a preset question answering strategy, and generating recommendation data corresponding to the target question based on a recommendation agent in a case where it is determined to execute the preset recommendation service; generating customer service question and answer sentences corresponding to the target question based on a summary agent according to the question answering data and the recommendation data; The recommendation agent generates recommendation data corresponding to the target question, comprising: obtaining associated dialogue data corresponding to the target question from historical dialogue data; performing vector matching on the associated dialogue data and a plurality of preset recommendation case data, and selecting target recommendation case data corresponding to the associated dialogue data according to a vector matching result; generating prompt information according to the target recommendation case data and the preset question answering strategy, and inputting the prompt information into the recommendation agent to enable the recommendation agent to generate recommendation data corresponding to the target question according to the prompt information. 2.The method of claim 1, wherein, The question answering agent comprises a query type agent and a knowledge type agent, and in a case where the target question answering agent is the query type agent, the target question answering agent processing the target question to generate question answering data corresponding to the target question comprises: inputting the target question and a plurality of interface description information corresponding to a plurality of preset query interfaces into the query type agent to enable the query type agent to select a target query interface corresponding to the target question from the plurality of preset query interfaces according to the plurality of interface description information, and generate parameter information corresponding to the target query interface according to the target question; matching the parameter information with preset parameter terms, and updating the parameter information according to a matching result; running the target query interface according to the updated parameter information, and generating question answering data corresponding to the target question according to a running result of the target query interface. 3.The method of claim 2, wherein, The matching of the parameter information with the preset parameter terms comprises: extracting a first preset parameter term corresponding to a parameter type matched with the parameter information from product sample information, matching the parameter information with the first preset parameter term to obtain a first matching result; performing regular matching of the parameter information with a second preset parameter term in a preset parameter library to obtain a second matching result; obtaining the matching result according to the first matching result and the second matching result. 4.The method of claim 2, wherein, In a case where the target question answering agent is the knowledge type agent, the target question answering agent processing the target question to generate question answering data corresponding to the target question comprises: The preset document knowledge data is divided into fragments to obtain a plurality of data fragments corresponding to the preset document knowledge data; The target keywords are extracted from the target question, and associated keywords having an association relationship with the target keywords are generated according to the word semantics of the target keywords, and the target keywords and the associated keywords are used as retrieval keywords; According to the retrieval keywords, target data fragments corresponding to the retrieval keywords are retrieved from the plurality of data fragments; The target question and the target data fragment are input into the knowledge type agent, so that the knowledge type agent generates question answering data corresponding to the target question according to the target data fragment. 5.The method of claim 1, wherein, The preset question and answer strategy and the preset recommended case data are generated in the following manner: Information extraction is performed on each dialogue data in the historical dialogue data to obtain the question and answer strategy corresponding to the dialogue data and the dialogue result corresponding to the dialogue data; According to the dialogue results corresponding to a plurality of dialogue data corresponding to the same question and answer strategy, the number of positive samples and the number of negative samples corresponding to the question and answer strategy are determined; According to the number of positive samples and the number of negative samples corresponding to the question and answer strategy, the strategy effectiveness of the question and answer strategy is calculated; In the case where the strategy effectiveness is higher than a preset threshold, the question and answer strategy is used as the preset question and answer strategy, and the preset recommended case data is generated according to the dialogue data corresponding to the question and answer strategy. 6.The method of claim 1, wherein, The summary agent is trained according to a preset question and a question and answer sentence of a preset question style corresponding to the preset question, and the customer question and answer sentence corresponding to the target question is generated based on the summary agent according to the question answering data and the recommended data, including: The question answering data and the recommended data are subjected to data filling processing and / or redundant data filtering processing; The processed question answering data and recommended data are input into the summary agent, so that the summary agent generates a customer question and answer sentence corresponding to the target question according to the preset question style.
7. A customer care system characterized in that, The customer service system includes a planning agent, a question and answer agent, a summary agent, and a recommendation agent; The planning agent is configured to determine a target question and answer agent for processing the target question from a plurality of question and answer agents according to a question type corresponding to the target question and function description information corresponding to the plurality of question and answer agents; The question and answer agent is configured to process the target question and generate question answering data corresponding to the target question; The planning agent is further configured to determine whether to perform a preset recommended service according to the target question, the question answering data corresponding to the target question, and a preset question and answer strategy; The recommendation agent is configured to generate recommended data corresponding to the target question in the case where it is determined to perform the preset recommended service; The summary agent is configured to generate a customer question and answer sentence corresponding to the target question according to the question answering data and the recommended data; The recommended data corresponding to the target question includes: According to the prompt information, recommended data corresponding to the target question is generated, wherein the prompt information is generated by the following way: Obtaining associated dialogue data corresponding to the target question from historical dialogue data; Vector matching the associated dialogue data and a plurality of preset recommended case data, and selecting target recommended case data corresponding to the associated dialogue data according to the vector matching result; Generating prompt information according to the target recommended case data and the preset question and answer strategy.
8. An electronic device, comprising: Comprise: One or more processors; A storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-6; One or more I / O interfaces connected between the processor and the memory, configured to realize the information interaction of the processor and the memory.
9. A computer readable medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method according to any one of claims 1-6.
Citation Information
Patent Citations
Man-machine cooperation method and system based on domain knowledge graph
CN114818740A
Large-model multi-agent-based financial management recommendation system and method
CN119048244A
Information query method, system, device and equipment, storage medium and program product
CN119179716A