Interaction method, electronic equipment and storage medium
By using interaction models in the AI Q&A system to identify and assign emotional keywords in user input statements, and automatically switch to the manual service channel, the problem that existing systems cannot respond to user emotional changes in time is solved, and user experience and interaction efficiency are improved.
Patent Information
- Application Number
- CN202411941839.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-25
AI Technical Summary
Existing AI Q&A systems usually require users to make active requests before switching to manual services, and cannot automatically identify and respond to user's emotional changes, resulting in the inability to obtain manual support in time when users are in a bad mood.
Through the interactive model, the emotional keywords in the input statement of the target user are identified, the emotional score is assigned, and the emotional score is automatically switched to the manual service channel when the emotional score reaches the warning condition.
It realizes automatic transfer of manual customer service according to user's emotional changes, improves interaction efficiency and user experience, and ensures that users can get manual support in a timely manner when they are in a bad mood.
Smart Images

Figure CN119886130A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an interaction method, an electronic device and a computer-readable storage medium. Background Art
[0002] With the rapid development of artificial intelligence technology, AI question-answering systems have become an indispensable tool in many industries and are widely used in customer service, smart assistants, e-commerce and other fields. AI question-answering systems usually rely on machine learning and deep learning models. Through training in a large corpus, the system has the ability to understand and generate natural language. At present, the more mature technologies include sequence models based on neural networks (such as RNN, LSTM) and Transformer models based on attention mechanisms (such as BERT, GPT). These technologies enable AI question-answering systems to understand the context, analyze the natural language text entered by users, identify user intentions, and generate appropriate answers through pre-trained language models or rule-based algorithms. These technologies not only effectively reduce the cost of manual customer service, but also significantly improve the response speed. However, the current AI question-answering system usually requires users to actively request to switch to manual service. Summary of the invention
[0003] The purpose of this application is to provide an interactive method, an electronic device and a storage medium.
[0004] To achieve the above objectives:
[0005] In a first aspect, an embodiment of the present application provides an interaction method, including:
[0006] Through the interaction model, the emotional keywords in the input sentence of the target user are identified, and the emotional score of the target user is assigned based on the emotional keywords to obtain the emotional score of the target user; the emotional score of the target user is accumulated, and when the emotional score meets the warning condition, it is automatically switched to the manual service channel.
[0007] In one embodiment, the construction of the interaction model includes the following steps: obtaining historical interaction sentences, identifying emotional keywords in the historical interaction sentences, and determining the emotional polarity of the historical interaction sentences based on the emotional keywords; the emotional polarity includes negative, neutral and positive; establishing emotional labels corresponding to the emotional polarity, and forming a training set through the historical interaction sentences and the corresponding emotional labels; training the preset layer weights of the pre-trained model through the training set to obtain the interaction model.
[0008] In one embodiment, the method of identifying emotional keywords in an input sentence of a target user through an interaction model and assigning an emotional score to the target user based on the emotional keywords to obtain an emotional score includes: extracting features from the input sentence of the target user through the interaction model, generating an emotional feature matrix, and determining the emotional polarity of the input sentence based on the emotional feature matrix; determining a corresponding emotional label according to the emotional polarity, and assigning an emotional score to the target user to obtain the emotional score; wherein, when the emotional label is negative, the emotional score assigned is a negative score; and / or, when the emotional label is neutral, the emotional score assigned is zero; and / or, when the emotional label is positive, the emotional score assigned is a positive score.
[0009] In one embodiment, the interaction method also includes: continuously identifying the emotional state of the target user; when negative emotional labels are identified multiple times in succession, determining that the emotional change trend of the target user is negative; issuing a warning signal through the interaction model, and automatically switching to a manual service channel.
[0010] In one embodiment, after the automatic switching to the manual service channel, the method further includes: extracting keywords from the reply text generated by the manual service channel in real time, and matching the extracted keywords with preset non-compliant words to detect the compliance of the reply text; when it is determined that the reply text is compliant, displaying the reply text through an interactive page with the target user.
[0011] In one embodiment, the interaction method further includes: recording the interaction content with the target user, and generating a conversation log based on the interaction content; and continuously training the interaction model using the conversation log.
[0012] In one embodiment, after the automatic switching to the manual service channel, the method further includes: generating a manual interaction prompt based on the original interaction content and / or the original emotional state of the target user, and displaying the manual interaction prompt content through a manual service page; when interacting with the target user through the manual service channel, analyzing the emotional state of the target user based on the interaction model.
[0013] In one embodiment, before identifying emotional keywords in the input sentence of the target user through the interaction model and assigning emotional scores to the target user based on the emotional keywords to obtain the emotional score of the target user, the method also includes: identifying key information in the input sentence to judge the interaction intention of the target user based on the key information, so that the interaction model prepares interaction content according to the interaction intention.
[0014] In a second aspect, the present application provides an electronic device, including:
[0015] processor;
[0016] a memory for storing processor-executable instructions;
[0017] Among them, the processor is configured to execute instructions to implement any interactive method of the first aspect.
[0018] In a fourth aspect, the present application provides a computer-readable storage medium, which, when instructions in the computer-readable storage medium are executed by a processor, implements an interaction method as described in any one of the first aspects.
[0019] The interactive method, electronic device and computer-readable storage medium provided by the present application, the interactive method includes: identifying emotional keywords in the input sentence of the target user through the interactive model, and assigning emotional scores to the target user based on the emotional keywords to obtain the emotional score of the target user; accumulating the emotional scores of the target user, and automatically switching to the manual service channel when the emotional score meets the warning condition. Therefore, the interactive method provided by the present application, by assigning points to the emotions of the target user, automatically switches to the manual service channel when the emotional score reaches a preset warning threshold. In this way, it is possible to automatically transfer to manual customer service in a timely manner according to the emotional changes of the target user, thereby improving the interaction efficiency and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of a flow chart of an interactive method provided by an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of the implementation process of the interactive method provided by the embodiment of the present invention;
[0022] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0024] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0025] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate the existence of features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, “A, B, or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will occur only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.
[0026] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0027] It should be noted that in this article, step codes such as S1 and S2 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S2 first and then S1, etc., but these should all be within the scope of protection of this application.
[0028] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0030] See also Figure 1 , is a flow chart of an interaction method provided in an embodiment of the present application. The interaction method can be executed by an electronic device provided in an embodiment of the present application. The interaction method provided in this embodiment includes:
[0031] Step S1, identifying emotional keywords in the input sentence of the target user through the interaction model, and assigning emotional scores to the target user based on the emotional keywords to obtain the emotional score of the target user.
[0032] It can be understood that the target user specifically refers to the user who is communicating or interacting. The target user can initiate consultation or seek help from the system through text or voice. The system receives the user's input and pre-processes it. If it is voice input, the system will convert the voice into text through the voice recognition function. If it is text input, it will directly go to the next step.
[0033] In this embodiment, the emotional intensity and emotional color of the emotional keywords can be determined by linking the context content. When assigning emotional scores, not only the appearance of the keywords should be considered, but also the entire context and the relationship between the words should be analyzed to accurately infer the emotional state of the target user, thereby accurately obtaining the emotional score of the target user.
[0034] In one embodiment, the construction of the interaction model includes the following steps: obtaining historical interaction sentences, identifying emotional keywords in the historical interaction sentences, and determining the emotional polarity of the historical interaction sentences based on the emotional keywords; emotional polarity includes negative, neutral and positive; establishing emotional labels corresponding to the emotional polarity, and forming a training set through historical interaction sentences and corresponding emotional labels; training the preset layer weights of the pre-trained model through the training set to obtain the interaction model.
[0035] Here, after obtaining the historical interaction sentences, data cleaning is also required, such as removing noise and irrelevant information in the historical interaction sentences, such as HTML tags, non-text content (emoticons, numbers, special punctuation marks), etc. Next, the dialogue text in the historical interaction sentences needs to be segmented into subwords or word units, especially the Chinese dialogue content, which needs to be segmented. Then, the processed text is converted into digital codes so that the model can recognize and understand the text content. In addition, when inputting the digital code into the model, it should also be ensured that the length of all input sequences is consistent.
[0036] In this embodiment, the pre-trained model can be BERT, RoBERTa, GPT, and these models can already capture rich language features. The pre-trained model is fine-tuned according to the emotion recognition task. The fine-tuning process can be to add several layers of fully connected networks on the basis of the pre-trained model, and train the added fully connected networks through the training set, so that the trained model (interaction model) can accurately identify the emotional polarity corresponding to the user's interactive sentences, thereby determining the emotional label corresponding to the emotional polarity, and then accurately assigning emotional scores to users.
[0037] The emotional keywords in the input sentence of the target user are identified through the interaction model, and the emotional score is assigned to the target user based on the emotional keywords to obtain the emotional score, including: extracting features of the input sentence of the target user through the interaction model, generating an emotional feature matrix, and determining the emotional polarity of the input sentence based on the emotional feature matrix; determining the corresponding emotional label according to the emotional polarity, and assigning the emotional score to the target user to obtain the emotional score; wherein, when the emotional label is negative, the emotional score assigned is negative; and / or, when the emotional label is neutral, the emotional score assigned is zero; and / or, when the emotional label is positive, the emotional score assigned is positive.
[0038] In this embodiment, when analyzing the emotional state of the target user through the interaction model, whether the user's emotion is positive, neutral or negative is detected, and the interaction model determines the target user's emotional polarity by analyzing the target user's semantics, grammatical structure and context information. When assigning emotion scores, different scores can be assigned according to the strength of the emotion. The strength of the emotion can be judged by the number of times negative and / or positive words appear, modal particles and the use of punctuation marks.
[0039] Step S2, accumulating the emotion scores of the target users, and automatically switching to the manual service channel when the emotion scores meet the warning conditions.
[0040] As mentioned above, when the emotion label is negative, the assigned emotion score is negative, that is, the stronger the negative attribute of the target user, the smaller the emotion score obtained. In this embodiment, the warning condition can be that the emotion score is less than a certain warning threshold. For example, if the warning threshold is negative 5 points, then when the emotion score is less than negative 5 points, it is considered that the target user meets the warning condition, and the target user is automatically transferred to the manual service channel.
[0041] In one embodiment, the interaction method further includes: continuously identifying the emotional state of the target user; when negative emotional labels are identified multiple times in succession, determining that the target user's emotional change trend is negative; issuing a warning signal through the interaction model, and automatically switching to a manual service channel.
[0042] Understandably, when it is determined that the emotional trend of the target user is negative, it is directly switched to the manual service channel, and the manual customer service can make timely adjustments to the interactive content, thereby avoiding the continued deterioration of the target user's emotions.
[0043] In one embodiment, after automatically switching to the manual service channel, the method further includes: extracting keywords from the reply text generated by the manual service channel in real time, and matching the extracted keywords with preset non-compliant words to detect the compliance of the reply text; when it is determined that the reply text is compliant, displaying the reply text through an interactive page with the target user.
[0044] It can be understood that by using natural language processing technology to extract keywords from the text to analyze the reply text generated by the manual service channel, the main information and core topics in the reply text can be identified. These keywords can represent the main content of the text, so that it can be judged whether the reply text of the manual customer service meets the reply requirements. The extracted keywords are compared with the preset non-compliant vocabulary list to detect whether the reply text contains any inappropriate, sensitive or illegal words to ensure the compliance of the reply content. In this way, it can ensure that timely and compliant replies are provided to users, enhance user experience, and improve service quality and efficiency.
[0045] In one embodiment, the interaction method further includes: recording the interaction content with the target user, and generating a dialogue log based on the interaction content; and continuously training the interaction model using the dialogue log.
[0046] It is understandable that the actual interaction content reflects the real needs and expressions of users. Using this data for training can make the interaction model better adapt to the user's communication habits and language style. In addition, the actual conversation contains rich contextual information. Training with this data can improve the interaction model's ability to understand the context, thereby generating more accurate and natural responses. By continuously training and optimizing the interaction model using conversation logs, the accuracy of the interaction model's emotional triggering and emotional analysis capabilities are improved.
[0047] In one embodiment, after automatically switching to the manual service channel, the method further includes: generating a manual interaction prompt based on the original interaction content and / or the original emotional state of the target user, and displaying the manual interaction prompt content through the manual service page; when interacting with the target user through the manual service channel, analyzing the emotional state of the target user based on the interaction model.
[0048] In this embodiment, during the interaction between the target user and the manual customer service, the system will still perform sentiment analysis to ensure that the manual customer service can quickly understand the target user's problem and solve and appease the target user based on the target user's problem or emotion.
[0049] In one embodiment, before identifying emotional keywords in the input sentence of the target user through the interaction model and assigning emotional scores to the target user based on the emotional keywords to obtain the emotional score of the target user, the method also includes: identifying key information in the input sentence to judge the interaction intention of the target user based on the key information, so that the interaction model prepares interaction content according to the interaction intention.
[0050] The natural language processing model can be used to analyze the user's input sentences in real time and identify the user's intention, such as asking for information, seeking help or making a complaint. At the same time, key information in the user's input sentence, such as date, location, name, etc., can also be identified to prepare for subsequent answers. After identifying the user's intention, the interaction model can generate appropriate answers through natural language based on the user's intention and the retrieved information. If the user's question involves knowledge base query or database retrieval, the database interface can also be used to obtain relevant information and organize it into a reasonable answer.
[0051] In addition, when the user's question is answered or the user actively expresses the end of the consultation, the system records and organizes the entire conversation process and saves the conversation log, including the results of sentiment analysis and customer service intervention. The system can also request feedback from users and ask them about their satisfaction with the answers and services, so as to further optimize system performance through user feedback.
[0052] The interactive method provided in this embodiment can analyze the emotional state of the target user in real time during the process of the target user interacting with the interactive model. This dynamic emotional analysis capability enables the system to quickly capture the emotional changes of the user, especially when the user's emotions gradually become negative, the system and manual customer service can make adjustments in time to avoid the deterioration of the problem. When it is detected that the negative emotions of the target user reach a certain warning value, the system will automatically trigger the intervention of manual customer service. This mechanism not only eliminates the cumbersome operation of users manually requesting customer service, but also ensures that users get more timely and personalized service responses before negative emotions break out, effectively improving the efficiency of problem solving and user satisfaction. In addition, through the introduction of emotional analysis and early warning mechanisms, the system can more actively manage the user's emotional experience and reduce the operational burden and psychological pressure of users when encountering problems. This intelligent customer service switching process enables users to feel more intimate and efficient services when interacting with the system, thereby improving the overall experience. More importantly, with the introduction of emotional analysis, emotional early warning and manual intervention mechanisms, users can trust the AI question-answering system more because they know that when the system cannot fully meet their needs, there will be manual customer service intervention, and the customer service response strategy will be adjusted according to the user's emotional state. This enhanced sense of trust is crucial to maintaining long-term user relationships and helps improve user loyalty and satisfaction.
[0053] Based on the same inventive concept as the above embodiments, the interactive method provided by the present invention is described below by using a specific example. Figure 2 , including the following steps:
[0054] 1. User-initiated consultation: Users can initiate consultations or seek help from the AI question-answering system through text or voice. The system receives the user's input and pre-processes it. If it is voice input, the system will convert the voice into text through speech recognition (ASR); if it is text input, it will go directly to the next step.
[0055] 2. Natural language processing: The system analyzes the target user’s input through a natural language processing model to identify the target user’s intention, such as asking for information, seeking help, or making a complaint. At the same time, the system identifies key information in the user’s input, such as date, location, name, etc., in order to prepare for subsequent responses.
[0056] 3. Sentiment analysis: While analyzing the user's intention, the system also analyzes the user's emotional state in real time to detect whether the user's emotions are positive, neutral, or negative. The system determines the emotional polarity by analyzing the user's semantics, grammatical structure, and contextual information.
[0057] 4. Emotional early warning mechanism and feedback monitoring:
[0058] 1) Emotional warning mechanism: The system continuously analyzes the user's emotional state in multiple rounds of conversations, records the trend of emotional changes, and pays special attention to the frequency and intensity of negative emotions. If the system detects that the user's negative emotions reach a certain warning threshold, or the emotions continue to deteriorate in multiple rounds of conversations, the system will automatically issue a warning signal. At this time, the system determines that the user may be dissatisfied with the AI's answer or encounter complex problems.
[0059] 2) Feedback monitoring: After each answer is generated, the system analyzes the user's emotional feedback again. If the user's emotions remain negative after receiving the answer, the system will gradually accumulate emotional warning scores.
[0060] After analyzing the target user's emotional state, determine whether to trigger an early warning. If so, jump to the manual channel to allow manual customer service to access and conduct emotional analysis. Otherwise, generate a preliminary answer through AI (interaction model)
[0061] 5. AI generates preliminary answers: Based on the user's intent and the information retrieved by the system, AI generates appropriate answers through natural language generation. If the user's question involves knowledge base query or database retrieval, the system will obtain relevant information and organize it into a reasonable answer.
[0062] After AI generates a preliminary answer, it determines whether the target user needs to continue consulting. If so, the interaction model is called to perform natural language processing. Otherwise, the user's consultation is deemed to be over.
[0063] 6. Emotional warning trigger: When the target user's emotional score is lower than the warning threshold or negative emotional labels are continuously detected, the emotional warning is triggered. Once the warning is triggered, the system automatically transfers the conversation to the manual customer service and prompts the customer service about the user's emotional state and the previous conversation content, ensuring that the customer service can quickly understand the situation and provide more targeted help.
[0064] 7. Manual customer service intervention and sentiment analysis:
[0065] 1) Manual response: After the manual customer service is connected, the system will suspend the AI's automatic response, and the manual customer service will communicate with the user to solve and appease the user's problems or emotions.
[0066] 2) Sentiment analysis: During the interaction between users and human customer service, the system will still perform sentiment analysis to ensure that customer service can adjust the response strategy according to the user's emotional state, thereby helping the user's emotions gradually stabilize and obtain positive feedback.
[0067] 8. End of user consultation: When the user's question is answered, or the user actively expresses the end of the consultation, the system records the entire conversation process and saves the conversation log, including the results of sentiment analysis and customer service intervention.
[0068] 9. User feedback and evaluation: The system can request feedback from users and ask them how satisfied they are with the answers and services. These feedbacks will be used to further optimize system performance.
[0069] 10. Data update and model learning: The system uses user feedback, conversation logs, and sentiment analysis results for continuous learning and optimization of the system to improve the accuracy of future sentiment warning triggers and sentiment analysis capabilities.
[0070] Based on the same inventive concept as the above embodiments, an embodiment of the present invention provides an electronic device, such as Figure 3 As shown, the electronic device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 3 The processor 310 shown in the figure is not used to indicate that the number of the processor 310 is one, but is only used to indicate the positional relationship of the processor 310 relative to other devices. In actual applications, the number of the processor 310 may be one or more; similarly, Figure 3 The memory 311 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 311 relative to other devices. In practical applications, the number of memories 311 can be one or more. When the processor 310 runs the computer program, the above interaction method is implemented.
[0071] The electronic device may also include: at least one network interface 312. The various components in the electronic device are coupled together via a bus system 313. It is understood that the bus system 313 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 313 is not used in the following examples. Figure 3 Various buses are labeled as bus system 313.
[0072] The memory 311 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory 311 described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable types of memory.
[0073] The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device. Examples of these data include: any computer program used to operate on the electronic device, such as an operating system and an application; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program may include various applications, such as a media player (MediaPlayer), a browser (Browser), etc., which are used to implement various application services. Here, the program that implements the method of the embodiment of the present invention may be included in the application program.
[0074] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, in which a computer program is stored, and the computer-readable storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); or various devices including one or any combination of the above-mentioned memories, such as a server, etc. When the instructions stored therein are executed by a processor, the interaction method described in the above-mentioned embodiment is implemented.
[0075] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0076] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0077] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An interactive method, characterized in that: include: Identify emotional keywords in the target user's input sentence through the interaction model, and assign emotional scores to the target user based on the emotional keywords to obtain the target user's emotional score; The emotion score of the target user is accumulated, and when the emotion score meets the warning condition, the user is automatically switched to the manual service channel.
2. The method according to claim 1, characterized in that The construction of the interaction model includes the following steps: Acquire historical interaction sentences, identify emotional keywords in the historical interaction sentences, and determine the emotional polarity of the historical interaction sentences based on the emotional keywords; the emotional polarity includes negative, neutral, and positive; Establishing an emotion label corresponding to the emotion polarity, and forming a training set through the historical interaction sentences and the corresponding emotion label; The preset layer weights of the pre-trained model are trained using the training set to obtain the interaction model.
3. The method according to claim 1, characterized in that The step of identifying emotional keywords in the input sentence of the target user through the interaction model and assigning emotional scores to the target user based on the emotional keywords to obtain emotional scores includes: Extracting features of the input sentence of the target user through the interaction model and generating a sentiment feature matrix, and determining the sentiment polarity of the input sentence based on the sentiment feature matrix; Determine a corresponding emotion label according to the emotion polarity, and assign an emotion score to the target user to obtain the emotion score; Wherein, when the emotion label is negative, the emotion score assigned is a negative score; and / or, When the emotion label is neutral, the emotion score assigned is zero; and / or, When the emotion label is positive, the assigned emotion score is a positive score.
4. The method according to claim 1, characterized in that: The method further comprises: Continuously identifying the emotional state of the target user; When negative emotion labels are identified multiple times in succession, determining that the emotion change trend of the target user is negative; An early warning signal is issued through the interactive model, and the channel is automatically switched to a manual service channel.
5. The method according to claim 1, characterized in that After the automatic switching to the manual service channel, the method further includes: Extract keywords from the reply text generated by the manual service channel in real time, and match the extracted keywords with preset non-compliant words to detect the compliance of the reply text; When it is determined that the reply text is compliant, the reply text is displayed through an interactive page with the target user.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Recording the interaction content with the target user, and generating a conversation log based on the interaction content; The interaction model is continuously trained using the conversation log.
7. The method according to claim 1 or 4, characterized in that: After the automatic switching to the manual service channel, the method further includes: Generate a manual interaction prompt based on the original interaction content and / or the original emotional state of the target user, and display the manual interaction prompt content through a manual service page; When interacting with the target user through the manual service channel, the emotional state of the target user is analyzed based on the interaction model.
8. The method according to claim 1, characterized in that Before identifying the emotional keywords in the input sentence of the target user through the interaction model and assigning an emotional score to the target user based on the emotional keywords to obtain the emotional score of the target user, the method further includes: Identify key information in the input sentence to determine the target user's interaction intention based on the key information, so that the interaction model prepares interaction content based on the interaction intention.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the steps of the interaction method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor, the steps of the interaction method according to any one of claims 1 to 8 are implemented.