Context semantic understanding-based customer service method, equipment and program product
The customer service method and device leverage contextual semantic understanding to enhance user intent recognition and generate personalized responses, addressing language processing challenges and improving efficiency and satisfaction in intelligent customer service systems.
Patent Information
- Application Number
- CN202411168189.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-17
AI Technical Summary
Traditional intelligent customer service systems struggle with language processing difficulties, failing to understand complex language and context, leading to low efficiency and inability to handle non-standardized queries, resulting in suboptimal user problem-solving.
A customer service method and device based on contextual semantic understanding, utilizing a preset intent entity recognition model, dialogue state tracking, and deep learning strategies to accurately recognize user intent, track conversation states, and generate personalized responses, incorporating semantic completion and optimization to handle complex contexts and diverse user needs.
Enhances user intent recognition, improves problem-solving efficiency, and increases service satisfaction by accurately understanding user conversations, reducing manual intervention, and generating natural, personalized responses.
Smart Images

Figure CN119151552A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a customer service method, device and program product based on contextual semantic understanding. Background Art
[0002] With the rapid development of Internet financial services, the interaction between enterprises and customers has become more frequent, and customers' demand for services has also been increasing. Traditional manual customer service is costly, including staff salaries and training costs, so enterprises need to find more economical and efficient solutions. Based on this, AI-based intelligent customer service has gradually become an ideal alternative.
[0003] The traditional intelligent customer service method is a rule- and template-based customer service method, including: handling customer inquiries through preset rules and fixed answer templates.
[0004] However, traditional intelligent customer service technology has language processing difficulties and is unable to understand complex language and context. Templated responses are also unable to cope with situations outside of standardization or preset questions, making it difficult to solve user problems, resulting in low efficiency of intelligent customer service services. Summary of the invention
[0005] In view of this, the embodiments of the present invention provide a customer service method, device and program product based on contextual semantic understanding to eliminate or improve one or more defects existing in the prior art.
[0006] One aspect of the present invention provides a customer service method based on contextual semantic understanding, the method comprising the following steps:
[0007] In response to the received current conversation text of the user, the current conversation text is input into a preset intent entity recognition model, intent recognition and entity recognition are performed on the current conversation text to obtain user intent and text entity;
[0008] The user intention, text entity and current conversation text are stored as the current conversation state, and the historical conversation state corresponding to the user is updated; the historical conversation state includes at least one round of conversation state corresponding to the user;
[0009] Determine the next customer service action based on user intent and historical conversation status through a preset dialogue strategy; the preset dialogue strategy includes a second dialogue strategy based on rule matching and / or a first dialogue strategy based on deep learning; the first dialogue strategy refers to a strategy for determining the next customer service action by matching the current dialogue state and the historical dialogue state with predefined rules; the second dialogue strategy refers to modeling each round of dialogue state in the historical dialogue state through a self-attention mechanism, determining the key information in the historical dialogue state, and determining the strategy for the next customer service action based on the key information;
[0010] Execute the next customer service action and generate the corresponding customer service dialogue text and return it to the user.
[0011] In some embodiments of the present invention, when the preset dialogue strategy includes the first dialogue strategy and the second dialogue strategy, determining the next customer service action based on the user intention and the historical dialogue state through the preset dialogue strategy includes:
[0012] A first dialogue strategy is used to match the user intention and the historical dialogue state with the predefined rules to obtain a matching result;
[0013] When the matching result indicates a match failure, the key information in the historical dialogue state is determined through the second dialogue strategy, and the next customer service action is determined based on the key information.
[0014] In some embodiments of the present invention, when the next customer service action is a business processing action, executing the next customer service action and generating a corresponding customer dialogue text to return to the user includes:
[0015] According to the user's intention, the necessary information for the task is determined in the user's historical status;
[0016] Execute business processing based on necessary information of business tasks and obtain execution results;
[0017] Fill the execution result into the preset reply template to obtain the customer service dialogue text;
[0018] Return the customer service conversation text to the user.
[0019] In some embodiments of the present invention, before returning the customer service conversation text to the user, the method further includes:
[0020] Analyze historical conversation status through natural language processing technology to extract user preference information corresponding to the user;
[0021] Generate text optimization prompt information according to user preference information;
[0022] The customer service conversation text and text optimization prompt information are input into a preset large language model to optimize the customer service conversation text; the preset large language model user optimizes the customer service conversation text information according to the optimization target indicated by the text optimization prompt information, and outputs the optimized customer service conversation text.
[0023] In some embodiments of the present invention, when the next customer service action is a conversation advancement action, the next customer service action is executed and a corresponding customer conversation text is generated and returned to the user, including: determining and returning prompt information based on user intention and historical conversation status; the prompt information is used to prompt the user to advance the conversation process; and the prompt information is returned to the user as a customer conversation text to prompt the user to advance the conversation process.
[0024] In some embodiments of the present invention, before inputting the current dialogue text into a preset intent entity recognition model, the method further includes: performing semantic completion processing on the current dialogue text; semantic completion processing refers to performing semantic completion processing on the current dialogue text through a preset natural language processing model.
[0025] In some embodiments of the present invention, before inputting the current dialogue text into a preset intent entity recognition model, the method further includes: performing text error correction processing and / or text cleaning processing on the current dialogue text.
[0026] Another aspect of the present invention provides a customer service device based on contextual semantic understanding, including a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is used to execute the computer program / instructions. When the computer program / instructions are executed, the device implements the steps of the aforementioned customer service method based on contextual semantic understanding.
[0027] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the aforementioned customer service method based on contextual semantic understanding.
[0028] Another aspect of the present invention provides a computer program product, including a computer program / instruction, which implements the steps of the aforementioned customer service method based on contextual semantic understanding when executed by a processor.
[0029] The customer service method, device and program product based on contextual semantic understanding of the present invention input the current dialogue text into a preset intention entity recognition model in response to the received current dialogue text of the user, perform intention recognition and entity recognition on the current dialogue text, and obtain the user's intention and text entity; store the user's intention, text entity and current dialogue text as the current dialogue state, and update the user's corresponding historical dialogue state; the historical dialogue state includes at least one round of dialogue state corresponding to the user; determine the next customer service action based on the historical dialogue state through a preset dialogue strategy; the preset dialogue strategy includes a second dialogue strategy based on rule matching and / or a first dialogue strategy based on deep learning; the first dialogue strategy refers to a strategy for determining the next customer service action based on the current dialogue state and the historical dialogue state by matching with predefined rules; the second dialogue strategy refers to a strategy for determining the next customer service action based on the current dialogue state and the historical dialogue state The attention mechanism models each round of dialogue state in the historical dialogue state, determines the key information in the historical dialogue state, and determines the strategy for the next customer service action based on the key information; executes the next customer service action and generates the corresponding customer service dialogue text and returns it to the user, which can solve the problem of low efficiency of intelligent customer service business; can accurately understand the context in user conversations, capture the subtle differences in conversations, track conversation states, store and update historical conversation states, can accurately detect and identify key information in user conversations in complex contexts, improve the accuracy of conversation understanding, and at the same time, determine and execute the next customer service action through preset dialogue strategies, to achieve an intelligent customer service solution based on context understanding, which can reduce problem handling time while reducing manual participation, improve problem solving rate and service satisfaction, and improve the efficiency of upstream and downstream intelligent customer service business.
[0030] In addition, when the user's semantic expression is incomplete, the missing or incomplete current dialogue text can be predicted and completed through the preset semantic completion model based on the dialogue text provided by the user, combined with the historical dialogue status, the context and the key information extracted previously. This can improve the accuracy of user intent recognition and entity recognition, thereby further improving the problem-solving rate and service satisfaction of intelligent customer service, and further improving the efficiency of the upstream and downstream of the intelligent customer service business.
[0031] In addition, for questions without standard answers or non-preset questions, the deep learning model of the Transformer architecture is used to analyze and manage the user's historical conversation status, and combined with the contextual conversation information, the next customer service action is determined to provide reasonable suggestions and solutions. It can handle diverse user needs, thereby further improving the problem-solving rate and service satisfaction of intelligent customer service, and further improving the efficiency of the upstream and downstream of the intelligent customer service business.
[0032] In addition, for standardized reply templates, the customer service conversation text is adjusted and optimized through the prompt technology of the deep learning language model, and the optimized customer service conversation text is returned to the user. This can generate smooth and natural customer service conversation text that meets user preferences, making the conversation between the user and the intelligent customer service more similar to communication between people, thereby improving user satisfaction and trust.
[0033] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0034] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0036] Figure 1 It is a structural diagram of a customer service system based on contextual semantic understanding in one embodiment of the present invention.
[0037] Figure 2 It is a structural diagram of another customer service system based on contextual semantic understanding in one embodiment of the present invention.
[0038] Figure 3 The figure is a flow chart of a customer service method based on contextual semantic understanding in one embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0040] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0041] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0042] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0043] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0044] Figure 1 FIG. 1 is a schematic diagram of a customer service system based on contextual semantic understanding provided by an embodiment of the present application. Figure 1 As shown, the system at least includes: a natural language understanding module 110, a dialogue state tracking module 120, a dialogue strategy decision module 130 and a dialogue action execution module 140.
[0045] Figure 1 In the present invention, the user end and the server end refer to the terminals that need to conduct the user customer service dialogue based on artificial intelligence. In some embodiments of the present invention, the user end may be a mobile phone, a computer or a tablet computer, etc., and the server end may be a computer or a server, etc. The device type of the user end and the device type of the server end may be the same or different. This embodiment does not limit the implementation method of the user end and the server end.
[0046] In some embodiments of the present invention, the user end is used to conduct a user customer service dialogue with the server end, and the user end initiates a dialogue with the server end and sends the user dialogue text to the server end. After receiving the user dialogue text, the server end performs natural language understanding on the received current dialogue text through the natural language understanding module 110. Among them, natural language understanding includes understanding the current dialogue text, understanding the intention or demand expressed by the user through natural language, obtaining the user intention of sending the current dialogue text, and extracting key information from the current dialogue text, and identifying entities with specific meanings as text entities.
[0047] The user intent refers to the purpose or need of the user when sending a conversation text, such as asking for weather forecast or asking for prices, etc. The text entity refers to the specific information unit in the conversation text, such as name, place, organization, date, time, etc.
[0048] Specifically, the natural language understanding module 110 is used to: in response to receiving the current conversation text of the user, input the current conversation text into a preset intention entity recognition model, perform intention recognition and entity recognition on the current conversation text, and obtain user intention and text entity.
[0049] The preset intent entity recognition model refers to a pre-trained intent entity recognition model. In some embodiments of the present invention, the intent entity recognition model is obtained by training a preset dual intent and entity transformer classifier (Dual Intent and Entity Transformer Classifier, DIETClassifier) using training data.
[0050] The training data includes sample conversation texts and user intentions and text entities corresponding to the sample conversation texts.
[0051] Accordingly, the training process of the intent entity recognition model includes: inputting the sample conversation text into a preset dual intent and entity transformer classifier to obtain a training result; inputting the training result and the user intent and text entity corresponding to the sample conversation text into a loss function to obtain a loss result; training the dual intent and entity transformer classifier based on the loss result to reduce the difference between the training result and the corresponding user intent and text entity until the dual intent and entity transformer classifier converges to obtain the intent entity recognition model.
[0052] The intent entity recognition model trained by using dual intent and entity transformer classifiers can simultaneously identify user semantics and extract key information from conversation texts, share feature extraction networks, and learn joint representations during the training phase. Therefore, it can better understand user intentions and needs.
[0053] In actual implementation, the user intention and text entity may also be extracted by using a unified structure generation for universal information extraction (UIE) algorithm. This embodiment does not limit the implementation method of identifying the user intention and text entity.
[0054] Since the current dialogue text provided by the user may be semantically incomplete, for example, taking the current dialogue text "I want that" as an example, there is insufficient semantic information to clarify what "that" refers to, resulting in the possibility of inaccurate intent recognition and entity recognition in the preset intent entity recognition model. Based on this, in order to improve the accuracy of the preset intent entity recognition model, before performing intent recognition and entity recognition on the current dialogue text through the preset intent entity recognition model, the current dialogue text needs to be semantically completed.
[0055] In some embodiments of the present invention, the natural language understanding module 110 includes a semantic completion submodule and an intended entity recognition submodule.
[0056] Among them, the semantic completion submodule is used to perform semantic completion processing on the current dialogue text, and by processing the semantically incomplete current dialogue text, it becomes more complete and has a clear meaning. The intention entity recognition submodule is used to input the current dialogue text after semantic completion into the preset intention entity recognition model, and perform intention recognition and semantic recognition on the current dialogue text after semantic completion.
[0057] Specifically, the semantic completion submodule is used to input the current dialogue text into a preset semantic completion model, perform semantic completion on the current dialogue text, and obtain the semantically completed current dialogue text. The intention entity recognition submodule is used to input the semantically completed current dialogue text into a preset intention entity recognition model, perform intention recognition and entity recognition on the semantically completed current dialogue text, and obtain user intention and text entity.
[0058] Among them, the preset semantic completion model refers to a pre-trained semantic completion model. In some embodiments of the present invention, the semantic completion model is obtained by training a preset natural language processing model using training data, such as a text-to-text transfer transformer (Text-to-Text Transfer Transformer, T5), a generative pre-trained transformer 2 (Generative Pre-trained Transformer 2, GPT2), a general language model (General Language Model, GLM) or a bidirectional and auto-regressive transformer (Bidirectional and Auto-Regressive Transformers, BART). In this way, even if the dialogue text provided by the user lacks certain components or information, the preset semantic completion model can predict the missing parts and complete them, thereby making the current dialogue text clearer and easier to understand.
[0059] The training data includes sample dialogue text and semantically completed dialogue text corresponding to the sample dialogue text.
[0060] Accordingly, the training process of the semantic completion model includes: inputting the sample conversation text into a preset natural language processing model to obtain a training result; inputting the training result and the semantically completed conversation text into a loss function to obtain a loss result; training the natural language processing model based on the loss result to reduce the difference between the training result and the semantically completed conversation text until the natural language processing model converges to obtain a semantic completion model.
[0061] In addition, since the conversation text provided by the user may contain irrelevant information, spelling errors or other noise, in order to further improve the accuracy of intent recognition and text entity recognition, the current conversation text needs to be preprocessed before performing intent recognition and entity recognition on the current conversation text.
[0062] refer to Figure 2 In some embodiments of the present invention, the customer service based on contextual semantic understanding also includes a text preprocessing module 150. The text preprocessing module 150 is used to receive the current dialogue text, and when the current dialogue text is received, perform text preprocessing on the current dialogue text.
[0063] In some embodiments of the present invention, text preprocessing includes text cleaning and text error correction. Text cleaning refers to removing noise, irrelevant information and format inconsistencies in the current dialogue text, such as deleting useless parts such as special characters, punctuation marks, and spaces. Text error correction refers to correcting spelling errors, grammatical errors and other language problems in the current dialogue text to improve the accuracy and consistency of the current dialogue text.
[0064] In actual implementation, in the text preprocessing module 150, methods such as lowercase conversion, word segmentation, part-of-speech tagging, and synonym replacement can also be used to preprocess the current dialogue text to further improve the accuracy of natural language understanding.
[0065] After the natural semantic understanding module 110 obtains the user intent and text entity through the preset intent entity recognition model, the user intent, text entity and current dialogue text are sent to the dialogue state tracking module 120, so that after receiving the user intent, text entity and current dialogue text, the dialogue state tracking module 120 stores the received user intent, text entity and current dialogue text as the dialogue state of the current round, so as to track the dialogue text provided by the current user.
[0066] Specifically, the dialogue state tracking module 120 is used to store the user intention, text entity and current dialogue text as the current dialogue state, and update the historical dialogue state corresponding to the user, wherein the historical dialogue state includes at least one round of dialogue state corresponding to the user.
[0067] In addition, in the process of the natural semantic understanding module 110 processing and understanding the current dialogue text provided by the user, when the historical dialogue state is stored in the dialogue state tracking module 120, the dialogue text after semantic completion is made more coherent and meaningful by inputting the historical dialogue state and the current dialogue text into a preset semantic completion model, thereby further improving the completeness and accuracy of the dialogue text after semantic completion.
[0068] The dialogue state tracking module 120 tracks and updates the dialogue state during the dialogue process, including the user's intention, entities, historical dialogues, etc. By tracking the dialogue state, the system can more accurately identify the user's intention and provide an appropriate response, while providing the necessary data support for the system's decision-making process.
[0069] In some embodiments of the present invention, after updating the historical dialogue state, the dialogue state tracking module 120 sends the historical dialogue state and user intent to the dialogue strategy decision module 130, so that the dialogue strategy decision module 130 decides the next customer service action based on the historical dialogue state and user intent.
[0070] Specifically, the dialogue strategy decision module 130 is used to determine the next customer service action based on the user intention and the historical dialogue state through a preset dialogue strategy. The preset dialogue strategy includes a second dialogue strategy based on rule matching and / or a first dialogue strategy based on deep learning.
[0071] The first dialogue strategy refers to a strategy for determining the next customer service action by matching the user intent and historical dialogue status with predefined rules. After receiving the user intent and historical dialogue status, the dialogue strategy decision module 130 matches the user intent and historical dialogue status with predefined rules to determine the next customer service action to be performed. Predefined rules refer to a set of pre-set rules and logics used to guide the system on how to handle user input and needs.
[0072] For example, taking the current conversation text provided by the user as "When will my order be delivered?", the user intent obtained by intent recognition is "query the order status"; based on the user intent, when the order number is obtained from the historical conversation status, the next customer service action matched is "use the order number to query the order status and return the query result to the user"; when the order number is not obtained from the historical conversation status, the next customer service action matched is "prompt the user to provide the order number."
[0073] In some embodiments of the present invention, the second dialogue strategy is to manage the dialogue text provided by the user by using a deep learning model with a Transformer architecture. The self-attention mechanism of the deep learning model will model each round of dialogue text provided by the user, calculate the correlation between each round of dialogue, and pay attention to the key information in the historical dialogue state. Combine the key information to determine the next customer service action. By using the Transformer architecture to manage the dialogue, the self-attention mechanism is applied to the dialogue state of each round. Jointly train the maximum similarity of each dialogue state and each customer service action. During reasoning, compare the current dialogue state with all possible customer service actions, and select the customer service action with the highest similarity as the next customer service action.
[0074] Specifically, the second dialogue strategy refers to modeling each round of dialogue state in the historical dialogue state through the self-attention mechanism, determining the key information in the historical dialogue state, and determining the strategy for the next customer service action based on the key information.
[0075] For example, take the order number provided by the user in the latest round of current conversation text as an example; use the self-attention mechanism to focus on the key information "order number" and combine it with the previous user intention "query order status" to decide the next customer service action.
[0076] In actual implementation, in addition to the deep learning model based on the Transformer architecture, other policy learning algorithms can also be used, such as reinforcement learning. The dialogue decision strategy is learned through interaction with the environment, such as using the Deep Q-Network (DQN) to handle the dialogue strategy learning problem. Alternatively, a model-based reinforcement learning method uses an environmental model to predict state transitions and rewards, and optimizes the dialogue strategy through planning, such as the Deep Dyna-Q algorithm.
[0077] After the dialogue strategy decision module 130 decides the next customer service action of the system, Figure 1 As shown, the next customer service action is handed over to the dialogue action execution module 140 for execution. The dialogue action execution module 140 is used to execute the corresponding customer service action according to the user's intention and all the necessary task information required for the next customer service action, such as querying the business processing status, etc. After the action is executed, the action execution result is obtained, and the corresponding dialogue text is generated and sent to the user.
[0078] Specifically, the dialogue action execution module 140 is used to: execute the next customer service action and generate a corresponding customer service dialogue text to return to the user. The customer service dialogue text is generated based on the execution result and the preset reply template. The preset reply template refers to a preset dialogue text template. The corresponding dialogue text is obtained by filling the execution result into the preset reply template.
[0079] However, preset response templates often provide standardized answers, lack personalized services and are not smart enough. They are also unable to provide emotional support and empathy like human customer service. When dealing with consultations involving emotions, this may lead to a decline in user experience.
[0080] In order to solve the above problems, in some embodiments of the present invention, in order to improve the structured customer service dialogue text, the generated reply is made more personalized and closer to the actual needs of the user. Figure 2 As shown, the customer service system based on contextual semantic understanding also includes a reply generation module 160. The reply generation module 160 is used to: generate a customer service dialogue text based on the execution result and the preset reply template, and adjust and optimize the customer service dialogue text through the prompt technology of the deep learning language model, and return the optimized customer service dialogue text to the user.
[0081] The deep learning language model includes, but is not limited to, a natural language processing model GPT2 (Generative Pre-trained Transformer 2, GPT2) or a Qwen second generation 7B model (Qwen 2Series 7B Model, Qwen2-7B), etc. This embodiment does not limit the model type of the deep learning language model.
[0082] The reply generation module 160 combines rule templates and model generation to generate a customer service dialogue text that is both compliant with the specification and natural and smooth as a reply to the user after completing the next customer service action. The reply generation module 160 generates high-quality replies through prompt technology, combined with the dialogue state and preset reply templates, and intelligently optimizes to ensure that the reply content is closer to the user's personalized needs. This method helps to improve the user experience and make the dialogue system more intelligent and humane.
[0083] In actual implementation, the customer service dialogue text can also be optimized and adjusted by fine-tuning the natural language processing model GPT2 (Generative Pre-trained Transformer 2, GPT2) and other models, with the help of reinforcement learning from human feedback (RLHF) based on human feedback. This embodiment does not limit the implementation method of optimizing and adjusting the customer service dialogue text.
[0084] The following is a detailed introduction to the customer service method based on contextual semantic understanding provided by this application.
[0085] like Figure 3 As shown, the embodiment of the present application provides a customer service method based on contextual semantic understanding. In this embodiment, the method is used for Figure 1 and Figure 2 The customer service system based on contextual semantic understanding shown in FIG. 1 is used as an example to illustrate that the method at least includes steps S301 to S304:
[0086] Step S301, in response to receiving the current conversation text of the user, input the current conversation text into a preset intention entity recognition model, perform intention recognition and entity recognition on the current conversation text, and obtain user intention and text entity.
[0087] The current conversation text refers to the conversation text sent by the user from the user end to the server end, and the conversation with the intelligent customer service deployed on the server end. After receiving the current conversation text provided by the user, the server end performs natural language understanding on the received current conversation text. Natural language understanding includes understanding the current conversation text, understanding the intention or demand expressed by the user through natural language, obtaining the user's intention of sending the current conversation text, and extracting key information from the current conversation text to identify entities with specific meanings as text entities.
[0088] Among them, user intent refers to the purpose or need of the user when sending a conversation text. Text entity refers to the specific information unit in the conversation text.
[0089] The preset intent entity recognition model refers to a pre-trained intent entity recognition model. In some embodiments of the present invention, the intent entity recognition model is obtained by training a preset dual intent and entity transformer classifier using training data.
[0090] The training data includes sample conversation texts and user intentions and text entities corresponding to the sample conversation texts.
[0091] Accordingly, the training process of the intent entity recognition model includes: inputting the sample conversation text into a preset dual intent and entity transformer classifier to obtain a training result; inputting the training result and the user intent and text entity corresponding to the sample conversation text into a loss function to obtain a loss result; training the dual intent and entity transformer classifier based on the loss result to reduce the difference between the training result and the corresponding user intent and text entity until the dual intent and entity transformer classifier converges to obtain the intent entity recognition model.
[0092] Since the current dialogue text provided by the user may be semantically incomplete, the preset intent entity recognition model may have inaccurate intent recognition and inaccurate entity recognition. Based on this, in order to improve the accuracy of the preset intent entity recognition model, before the current dialogue text is semantically completed through the preset intent entity recognition model, the current dialogue text needs to be semantically completed.
[0093] Specifically, before inputting the current dialogue text into the preset intent entity recognition model, the process further includes: performing semantic completion processing on the current dialogue text, wherein the semantic completion processing refers to performing semantic completion processing on the current dialogue text through a preset natural language processing model.
[0094] In some embodiments of the present invention, the current dialogue text is input into a preset semantic completion model, and semantic completion is performed on the current dialogue text to obtain the semantically completed current dialogue text. The preset semantic completion model refers to a pre-trained semantic completion model.
[0095] In some embodiments of the present invention, the semantic completion model is obtained by training a preset language processing model using training data, such as a text-to-text transfer transformer (T5). In this way, even if the dialogue text provided by the user lacks certain components or information, the preset semantic completion model can predict the missing parts and complete them, thereby making the current dialogue text clearer and easier to understand.
[0096] The training data includes sample dialogue text and semantically completed dialogue text corresponding to the sample dialogue text.
[0097] Accordingly, the training process of the semantic completion model includes: inputting the sample conversation text into a preset natural language processing model to obtain a training result; inputting the training result and the semantically completed conversation text into a loss function to obtain a loss result; training the natural language processing model based on the loss result to reduce the difference between the training result and the semantically completed conversation text until the natural language processing model converges to obtain a semantic completion model.
[0098] In addition, since there is a possibility that the dialogue text provided by the user contains irrelevant information, spelling errors or other noise. Therefore, in order to further improve the accuracy of intent recognition and text entity recognition, before performing intent recognition and entity recognition on the current dialogue text, it is also necessary to perform text preprocessing on the current dialogue text. Text preprocessing includes text cleaning processing and text error correction processing. Among them, text cleaning processing refers to removing noise, irrelevant information and format inconsistencies in the current dialogue text, such as deleting useless parts such as special characters, punctuation marks, spaces, etc. Text error correction processing is to correct spelling errors, grammatical errors and other language problems in the current dialogue text to improve the accuracy and consistency of the current dialogue text.
[0099] Specifically, before inputting the current dialogue text into the preset intent entity recognition model, it also includes: performing text error correction processing and / or text cleaning processing on the current dialogue text.
[0100] In actual implementation, when semantic completion is required for the current dialogue text, text preprocessing can be performed on the current dialogue text before semantic completion, which can improve the accuracy of semantic completion.
[0101] Step S302, storing the user intention, text entity and current conversation text as the current conversation state, and updating the historical conversation state corresponding to the user; the historical conversation state includes at least one round of conversation state corresponding to the user.
[0102] In some embodiments of the present invention, in the process of processing and understanding the current dialogue text provided by the user, when there is a historical dialogue state, the historical dialogue state and the current dialogue text are input into a preset semantic completion model, so that the semantically completed dialogue text is made more coherent and meaningful, thereby further improving the completeness and accuracy of the semantically completed dialogue text.
[0103] Step S303: Determine the next customer service action based on the user's intention and the historical dialogue state through a preset dialogue strategy. The preset dialogue strategy includes a second dialogue strategy based on rule matching and / or a first dialogue strategy based on deep learning.
[0104] The first dialogue strategy refers to a strategy that determines the next customer service action by matching the current dialogue state and the historical dialogue state with predefined rules. The customer service action to be performed next is determined by matching the user's intention and the historical dialogue state with the predefined rules. The predefined rules refer to a set of rules and logics set in advance to guide the system on how to handle user input and needs.
[0105] The second dialogue strategy is to manage the dialogue text provided by the user by using a deep learning model with a Transformer architecture. The self-attention mechanism of the deep learning model will model each round of dialogue text provided by the user, calculate the correlation between each round of dialogue, and pay attention to the key information in the historical dialogue state. Combined with the key information, the next customer service action is determined.
[0106] Specifically, the second dialogue strategy refers to modeling each round of dialogue state in the historical dialogue state through the self-attention mechanism, determining the key information in the historical dialogue state, and determining the strategy for the next customer service action based on the key information.
[0107] In some embodiments of the present invention, the next customer service action is determined based on the user intention and the historical conversation status through a preset conversation strategy, including at least the following situations:
[0108] The first one is that when the preset dialogue strategy is the first dialogue strategy, the next customer service action is determined based on the user intention and the historical dialogue status through the preset dialogue strategy, including: matching the first dialogue strategy with the predefined rules based on the user intention and the historical dialogue status to obtain the next customer service action.
[0109] The second type is that when the preset dialogue strategy is the second dialogue strategy, the next customer service action is determined based on the user intention and the historical dialogue status through the preset dialogue strategy, including: determining the key information in the historical dialogue status through the second dialogue strategy, and determining the next customer service action based on the key information.
[0110] The third type is that when the preset dialogue strategy includes the first dialogue strategy and the second dialogue strategy, the next customer service action is determined based on the historical dialogue state through the preset dialogue strategy, including: matching the current dialogue state and the historical dialogue state with predefined rules to obtain a matching result through the first dialogue strategy; when the matching result indicates a match failure, determining the key information in the historical dialogue state through the second dialogue strategy, and determining the next customer service action based on the key information.
[0111] Step S304, executing the next customer service action and generating a corresponding customer service dialogue text and returning it to the user.
[0112] In some embodiments of the present invention, customer service actions include business processing actions or dialogue promotion actions. Business processing actions refer to specific operation steps or activities performed in a business process or operation, and are often used to promote the progress of a business process, complete tasks, or achieve specific goals, such as data entry or order query. Dialogue promotion actions refer to actions that promote the progress of a dialogue and ensure the fluency and effectiveness of a dialogue, such as inquiries or confirmations.
[0113] When the next customer service action is a business processing action, the information required to execute the next customer service action is determined from the stored historical status information corresponding to the user, and the next customer service action is executed. After the execution result is obtained, the result is filled into the preset reply template and returned to the user. The preset reply template refers to a preset dialogue text template.
[0114] Specifically, when the next customer service action is a business processing action, the next customer service action is executed and a corresponding customer conversation text is generated and returned to the user, including: according to the user's intention, determining the necessary task information in the user's historical status; executing business processing based on the necessary business task information to obtain the execution result; filling the execution result into a preset reply template to obtain a customer service conversation text; and returning the customer service conversation text to the user.
[0115] When the next customer service action is to advance the conversation, prompt information is determined based on the user's intent and historical conversation status to prompt the user to provide corresponding key information and advance the conversation process.
[0116] For example, if the current conversation text provided by the user is "When will my order be delivered?", the user intention obtained by intent recognition is "query the order status"; based on the user's intention, if the order number is not obtained from the historical conversation status, a prompt message "prompt the user to provide the order number" is generated; or, if the order number is obtained from the historical conversation status, a prompt message "prompt the user to confirm whether the order number is correct" is generated.
[0117] Specifically, when the next customer service action is a conversation advancement action, the next customer service action is executed and a corresponding customer conversation text is generated and returned to the user, including: determining and returning prompt information based on user intention and historical conversation status; the prompt information is used to prompt the user to advance the conversation process; and the prompt information is returned to the user as a customer conversation text to prompt the user to advance the conversation process.
[0118] In some embodiments of the present invention, in order to improve the structured customer service dialogue text and make the generated replies more personalized and closer to the actual needs of the user, it is also necessary to analyze the user's corresponding historical dialogue status through natural language processing technology (Natural Language Processing, NLP) to determine the user's preferences; and generate prompt information based on the user's preferences to modulate and optimize the customer service dialogue text, so that the optimized customer service dialogue text is more in line with the user's preferences, and the optimized customer service dialogue text is returned to the user.
[0119] Specifically, before returning the customer service conversation text to the user, it also includes: analyzing the historical conversation status through natural language processing technology to extract the user preference information corresponding to the user; generating text optimization prompt information according to the user preference information; inputting the customer service conversation text and the text optimization prompt information into a preset large language model to optimize the customer service conversation text; the preset large language model user optimizes the customer service conversation text information according to the optimization target indicated by the text optimization prompt information, and outputs the optimized customer service conversation text.
[0120] The preset large language model is a pre-set deep learning language model, including but not limited to the natural language processing model GPT2 (Generative Pre-trained Transformer 2, GPT-2) or Qwen second generation 7B model (Qwen2 Series 7B Model, Qwen2-7B), etc. This embodiment does not limit the model type of the deep learning language model.
[0121] In summary, the customer service method based on contextual semantic understanding provided by the present invention responds to the received current conversation text of the user, inputs the current conversation text into a preset intention entity recognition model, performs intent recognition and entity recognition on the current conversation text, and obtains the user's intention and text entity; stores the user's intention, text entity and current conversation text as the current conversation state, and updates the user's corresponding historical conversation state; the historical conversation state includes at least one round of conversation state corresponding to the user; determines the next customer service action based on the historical conversation state through a preset conversation strategy; the preset conversation strategy includes a second conversation strategy based on rule matching and / or a first conversation strategy based on deep learning; the first conversation strategy refers to a strategy for determining the next customer service action based on the current conversation state and the historical conversation state by matching with predefined rules; the second conversation strategy refers to a strategy for determining the next customer service action through self-attention The force mechanism models each round of dialogue state in the historical dialogue state, determines the key information in the historical dialogue state, and determines the strategy for the next customer service action based on the key information; executes the next customer service action and generates the corresponding customer service dialogue text and returns it to the user, which can solve the problem of low efficiency of intelligent customer service business; can accurately understand the context in the user conversation, capture the subtle differences in the conversation, track the dialogue state storage and update the historical dialogue state, can accurately detect and identify the key information in the user conversation in a complex context, and improve the accuracy of dialogue understanding; at the same time, through the preset dialogue strategy, the next customer service action is determined and executed, thereby realizing an intelligent customer service solution based on context understanding, which can reduce problem handling time while reducing manual participation, improve problem solving rate and service satisfaction, and improve the efficiency of upstream and downstream intelligent customer service business.
[0122] In addition, when the user's semantic expression is incomplete, the missing or incomplete current dialogue text can be predicted and completed through the preset semantic completion model based on the dialogue text provided by the user, combined with the historical dialogue status, the context and the key information extracted previously. This can improve the accuracy of user intent recognition and entity recognition, thereby further improving the problem-solving rate and service satisfaction of intelligent customer service, and further improving the efficiency of the upstream and downstream of the intelligent customer service business.
[0123] In addition, for questions without standard answers or non-preset questions, the deep learning model of the Transformer architecture is used to analyze and manage the user's historical conversation status, and combined with the contextual conversation information, the next customer service action is determined to provide reasonable suggestions and solutions. It can handle diverse user needs, thereby further improving the problem-solving rate and service satisfaction of intelligent customer service, and further improving the efficiency of the upstream and downstream of the intelligent customer service business.
[0124] In addition, for standardized reply templates, the customer service conversation text is adjusted and optimized through the prompt technology of the deep learning language model, and the optimized customer service conversation text is returned to the user. This can generate smooth and natural customer service conversation text that meets user preferences, making the conversation between the user and the intelligent customer service more similar to communication between people, thereby improving user satisfaction and trust.
[0125] Corresponding to the above method, the present invention also provides a customer service device based on contextual semantic understanding, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the aforementioned customer service method based on contextual semantic understanding.
[0126] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the customer service method based on contextual semantic understanding are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0127] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned customer service method based on contextual semantic understanding when executed by a processor.
[0128] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0129] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0130] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0131] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A customer service method based on contextual semantic understanding, It is characterized in that The method comprises the following steps: In response to the received current conversation text of the user, the current conversation text is input into a preset intention entity recognition model, and the intention recognition and entity recognition are performed on the current conversation text to obtain the user intention and text entity; The user intention, the text entity and the current conversation text are stored as the current conversation state, and the historical conversation state corresponding to the user is updated; the historical conversation state includes at least one round of conversation state corresponding to the user; Determine the next customer service action based on the user intention and the historical dialogue state through a preset dialogue strategy; the preset dialogue strategy includes a second dialogue strategy based on rule matching and / or a first dialogue strategy based on deep learning; the first dialogue strategy refers to a strategy for determining the next customer service action by matching the current dialogue state and the historical dialogue state with predefined rules; the second dialogue strategy refers to modeling each round of dialogue state in the historical dialogue state through a self-attention mechanism, determining key information in the historical dialogue state, and determining the strategy for the next customer service action based on the key information; Execute the next customer service action and generate a corresponding customer service dialogue text and return it to the user.
2. The method according to claim 1, It is characterized in that In the case where the preset dialogue strategy includes the first dialogue strategy and the second dialogue strategy, determining the next customer service action based on the user intention and the historical dialogue state by using the preset dialogue strategy includes: The first dialogue strategy is used to match the user intention and the historical dialogue state with a predefined rule to obtain a matching result; When the matching result indicates a matching failure, the key information in the historical dialogue state is determined by the second dialogue strategy, and the next customer service action is determined based on the key information.
3. The method according to claim 1, It is characterized in that In the case where the next customer service action is a business processing action, executing the next customer service action and generating a corresponding customer dialogue text to return to the user includes: According to the user intention, determining necessary task information in the user history state; Execute business processing based on the necessary information of the business task and obtain execution results; Fill the execution result into the preset reply template to obtain the customer service dialogue text; The customer service conversation text is returned to the user.
4. The method according to claim 3, It is characterized in that Before returning the customer service conversation text to the user, the method further includes: Analyzing the historical conversation state by natural language processing technology to extract user preference information corresponding to the user; Generate text optimization prompt information according to the user preference information; The customer service conversation text and the text optimization prompt information are input into a preset large language model to optimize the customer service conversation text; the preset large language model user optimizes the customer service conversation text information according to the optimization target indicated by the text optimization prompt information, and outputs the optimized customer service conversation text.
5. The method according to claim 1, It is characterized in that In the case where the next customer service action is a conversation advancement action, executing the next customer service action and generating a corresponding customer conversation text to return to the user includes: determining and returning prompt information based on the user intention and the historical conversation status; the prompt information is used to prompt the user to advance the conversation process; and returning the prompt information to the user as the customer conversation text to prompt the user to advance the conversation process.
6. The method according to claim 1, It is characterized in that Before inputting the current dialogue text into a preset intent entity recognition model, the method further includes: performing semantic completion processing on the current dialogue text; the semantic completion processing refers to performing semantic completion processing on the current dialogue text through a preset natural language processing model.
7. The method according to claim 1, It is characterized in that Before inputting the current dialogue text into a preset intent entity recognition model, the method further includes: performing text error correction processing and / or text cleaning processing on the current dialogue text.
8. A customer service device based on contextual semantic understanding, comprising a processor, a memory, and a computer program / instruction stored in the memory, It is characterized in that The processor is used to execute the computer program / instructions. When the computer program / instructions are executed, the device implements the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instructions stored thereon, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Fraud countering method based on key business voiceprint
CN120808791A
Omnichannel session seamless switching method and system based on reinforcement learning
CN122285853A
A method and system for seamless switching of full-channel conversations based on reinforcement learning
CN122285853B
