Emotion recognition method and device, computer equipment and storage medium
Through the pre-trained key information extraction model, it can identify emotional nodes and related information in customer communication, solve the problem of customer emotion recognition in the financial industry and improve service quality and user experience.
Patent Information
- Application Number
- CN202411280440.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-01-10
AI Technical Summary
In the financial industry, customer sentiment cannot be accurately identified during the customer service process, resulting in low communication efficiency, accuracy and consistency difficult to ensure, affecting service quality and user experience.
The pre-trained key information extraction model is used to obtain customer communication information, generate emotional node information and emotional association information, and obtain emotional recognition results through emotion classification and recognition to achieve accurate identification of customer emotions.
It effectively realizes emotional recognition in customer communication process, improves the accuracy and consistency of financial services, and improves user experience and service quality.
Smart Images

Figure CN119294400A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, specifically to the field of financial technology, and in particular to an emotion recognition method, device, computer equipment and storage medium. Background Art
[0002] In recent years, with the rapid development of Internet technology and the widespread penetration of social media platforms, the interaction mode between enterprises and customers is undergoing unprecedented changes. Mobile chat software such as WeChat and various instant messaging tools (IM) have gradually replaced traditional communication methods such as email and telephone with their convenience, real-time and multimedia support features, becoming the mainstream channel for enterprises to interact with customers. This trend is particularly evident in the financial industry. However, the particularity of financial services requires a higher level of customer care and customized services, which poses a huge challenge to the traditional service model.
[0003] In the financial industry, professionalism and personalization of customer service are crucial. Customers often need professional service personnel to interpret complex financial products and find solutions that meet their risk preferences and investment goals. This process is often accompanied by in-depth and detailed communication. If not handled properly, the long communication cycle may cause customer fatigue, misunderstandings and even dissatisfaction, ultimately leading to customer churn or increased complaints.
[0004] Therefore, how to accurately capture and understand the emotional state of customers in the process of communicating with them has become the key to improving the quality of financial services and user experience. At present, although there are some preliminary solutions in the market that attempt to evaluate customer emotions through text analysis, most of these methods rely on the subjective judgment of customer service personnel, which is not only inefficient, but also due to the differences in the professional qualities of customer service personnel, it is difficult to ensure the accuracy and consistency of emotion recognition, which brings certain difficulties to the development of financial business services. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide an emotion recognition method, apparatus, computer equipment and storage medium to solve the problem of being unable to accurately and effectively recognize emotions during customer communication.
[0006] In order to solve the above technical problems, the present application embodiment provides an emotion recognition method, which adopts the following technical solution:
[0007] Obtain customer communication information;
[0008] Inputting the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values;
[0009] Generate emotional node information and emotional association information according to the customer communication keywords and the keyword emotional intensity values;
[0010] Performing emotion classification based on the emotion node information and the emotion association information to obtain emotion category information;
[0011] Emotion recognition is performed according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result.
[0012] Furthermore, the step of obtaining customer communication information specifically includes:
[0013] Obtain original communication information;
[0014] Performing non-standard information identification on the original communication information to obtain non-standard communication information;
[0015] Standardizing the non-standard communication information to obtain standard communication information;
[0016] The original communication information is updated according to the standard communication information to obtain the customer communication information.
[0017] Furthermore, before the step of inputting the customer communication information into the pre-trained key information extraction model to obtain the customer communication keywords and keyword emotion intensity values, the following steps are also included:
[0018] Obtain sample communication information;
[0019] Preprocessing the sample communication information to obtain standard sample communication information;
[0020] Perform keyword tagging on the standard sample communication information to obtain sample communication keywords;
[0021] quantifying the emotional intensity of the sample communication keywords to obtain the emotional intensity value of the sample keywords;
[0022] The preset natural language processing model is trained according to the sample communication keywords and the sample keyword emotion intensity values to obtain the key information extraction model.
[0023] Furthermore, the step of generating the emotion node information and the emotion association information according to the customer communication keywords and the keyword emotion intensity values specifically includes:
[0024] Obtaining a preset emotion category, and generating a first emotion node according to the emotion category;
[0025] Correspondingly associating the customer communication keyword with the keyword emotion intensity value to generate a second emotion node;
[0026] Generate the emotion node information according to the first emotion node and the second emotion node;
[0027] Acquiring sequence information of the customer communication keywords, and sequentially connecting the customer communication keywords according to the sequence information to obtain a first emotion association relationship;
[0028] Correspondingly associating the customer communication keyword with the emotion category according to the keyword emotion intensity value to obtain a second emotion association relationship;
[0029] The emotion association information is generated according to the first emotion association relationship and the second emotion association relationship.
[0030] Furthermore, the step of performing emotion classification based on the emotion node information and the emotion association information to obtain emotion category information specifically includes:
[0031] Calculate an emotion category score according to the emotion node information and the emotion association information;
[0032] Obtaining an emotion threshold corresponding to the emotion category score;
[0033] Emotion classification is performed according to the emotion category score and the emotion threshold to obtain the emotion category information.
[0034] Furthermore, the step of calculating the emotion category score according to the emotion node information and the emotion association information specifically includes:
[0035] Get preset parameter information;
[0036] Constructing a graph according to the preset parameter information, the emotion node information, and the emotion association information to obtain an emotion change graph;
[0037] Acquiring emotion change trend information based on the emotion change graph;
[0038] The customer communication information is converted into a communication information vector, and the emotion change trend information and the communication information vector are input into a pre-trained emotion evaluation model to obtain the emotion category score.
[0039] Furthermore, the step of performing emotion recognition according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result specifically includes:
[0040] Performing weighted calculation according to the emotion category information and the keyword emotion intensity value to obtain an emotion category intensity value;
[0041] Mapping the emotion category intensity value to a preset emotion level table to obtain the emotion category level;
[0042] The emotion category level is used as the emotion recognition result.
[0043] In order to solve the above technical problems, the embodiment of the present application further provides an emotion recognition device, which adopts the following technical solution:
[0044] Information acquisition module, used to obtain customer communication information;
[0045] An information extraction module, used for inputting the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values;
[0046] An information generation module, used to generate emotion node information and emotion association information according to the customer communication keywords and the keyword emotion intensity values;
[0047] An information classification module, used to classify emotions based on the emotion node information and the emotion association information to obtain emotion category information;
[0048] The result recognition module is used to perform emotion recognition according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result.
[0049] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0050] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of any of the above-mentioned emotion recognition methods when executing the computer-readable instructions.
[0051] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0052] A computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the emotion recognition method described in any one of the above items are implemented.
[0053] Compared with the prior art, the embodiment of the present application has the following beneficial effects: the embodiment obtains customer communication information; inputs the customer communication information into the pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; generates emotion node information and emotion association information based on the customer communication keywords and the keyword emotion intensity values; performs emotion classification based on the emotion node information and the emotion association information to obtain emotion category information; performs emotion recognition based on the emotion category information and the keyword emotion intensity values to obtain emotion recognition results. Thus, the emotions in the customer communication process can be accurately and effectively recognized. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0056] Figure 2 A flowchart of an embodiment of an emotion recognition method according to the present application;
[0057] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S10;
[0058] Figure 4 yes Figure 3 A flowchart of a specific implementation of step S40;
[0059] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S401;
[0060] Figure 6 yes Figure 2 A flowchart of a specific implementation of step S50;
[0061] Figure 7 is a schematic structural diagram of an embodiment of an emotion recognition device according to the present application;
[0062] Figure 8 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0064] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor does it refer to non-related or alternative embodiments that are mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0065] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0066] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0067] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0068] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0069] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0070] It should be noted that the emotion recognition method provided in the embodiment of the present application is generally executed by a server, and accordingly, the emotion recognition device is generally set in the server.
[0071] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0072] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for emotion recognition according to the present application. The emotion recognition method comprises the following steps:
[0073] Step S10, obtaining customer communication information;
[0074] In this embodiment, customer communication information refers to the data and information generated during all communications and interactions with customers, and is standard information generated through standardized processing. Customer communication information includes chat records of instant messaging tools (such as communication software, online communication pages, etc.), and online customer service conversations within websites or applications; information submitted through online forms, such as contact information, product inquiries, service requests, etc.; recordings of telephone calls between customers and customer service representatives, mainly containing customers' questions, needs, complaints or emotional expressions; and voice messages sent through voice assistants or instant messaging tools.
[0075] Step S20, inputting the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values;
[0076] In this embodiment, the key information extraction model adopts the BERT model, which is a pre-trained language representation model based on the Transformer structure. The BERT model is used to obtain customer communication keywords and keyword emotion intensity values. Customer communication keywords refer to the words expressing emotions and related to emotional expression in customer communication information. The keyword emotion intensity value refers to a quantitative indicator used to measure the intensity of the emotional tendency contained in each customer communication keyword. The emotion intensity value is a value between -1 and 1 (where -1 represents extreme negative emotions, 0 represents neutral emotions, and 1 represents extreme positive emotions), which is calculated and obtained by the key information extraction model.
[0077] Step S30, generating emotion node information and emotion association information according to the customer communication keywords and the keyword emotion intensity values;
[0078] In this embodiment, the emotion node information includes a first emotion node and a second emotion node. The first emotion node is node information generated according to the emotion category. Each emotion category corresponds to a first emotion node. The emotion categories include: happy, sad, angry, surprised, etc. The second emotion node is node information generated by associating customer communication keywords and keyword emotion intensity values, wherein each customer communication keyword corresponds to a keyword emotion intensity value. The emotion association information includes a first emotion association relationship and a second emotion association relationship. The first emotion association relationship is relationship information generated by sequentially connecting customer communication keywords in the order of appearance, which is used to analyze the emotional changes and flows in the customer communication process. The second emotion association relationship is relationship information that corresponds customer communication keywords and emotion categories through keyword emotion intensity values, which is used to match customer communication keywords and emotion categories.
[0079] Step S40, performing emotion classification based on the emotion node information and the emotion association information to obtain emotion category information;
[0080] In this embodiment, the emotion category score is calculated by the emotion node information and the emotion association information, and then the emotion classification is performed according to the emotion category score to obtain accurate emotion category information. The emotion category information refers to the overall emotional tendency of the customer during the communication process. The emotion category information includes positive emotions: indicating that the customer shows positive, pleasant, and satisfied emotions during the communication process. Common positive emotion categories include happiness, joy, satisfaction, excitement, love, etc. Negative emotions: indicating that the customer expresses negative, dissatisfied, and frustrated emotions during communication. Common negative emotion categories include anger, anger, sadness, disappointment, anxiety, fear, etc. Neutral emotions: indicating that the customer's communication content has no obvious emotional tendency, or the emotional expression is relatively bland. Neutral emotions usually do not have strong positive or negative colors. Mixed emotions: In some cases, the customer's communication content may contain multiple emotions at the same time, and these emotions may contradict or intertwine with each other. The mixed emotion category is used to describe this complex emotional state and needs to be subdivided and identified according to the specific situation.
[0081] Step S50: performing emotion recognition according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result.
[0082] In this embodiment, the emotion recognition result is the emotion judgment result outputted finally, which is used to represent the emotion of the customer in the communication process. The emotion recognition result is correspondingly provided with an emotion category level, and the emotion category level includes a positive emotion level: mild positive: such as "satisfied", "pleased", etc., indicating that the customer has a slight positive attitude towards the communication content or result; moderate positive: such as "happy", "excited", etc., indicating that the customer is relatively satisfied or excited about the communication content or result; highly positive: such as "extremely satisfied", "ecstatic", etc., indicating that the customer has a very strong positive attitude towards the communication content or result. Negative emotion level: mild negative: such as "dissatisfied", "disappointed", etc., indicating that the customer has a slight negative attitude towards the communication content or result; moderate negative: such as "angry", "furious", etc., indicating that the customer is relatively dissatisfied or angry about the communication content or result; highly negative: such as "extremely dissatisfied", "furious", etc., indicating that the customer has a very strong negative attitude towards the communication content or result. Neutral emotion: indicates that the customer does not show obvious positive or negative emotions during the communication process, specifically a bland, emotionless or neutral attitude.
[0083] This embodiment obtains customer communication information; inputs the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; generates emotion node information and emotion association information based on the customer communication keywords and the keyword emotion intensity values; performs emotion classification based on the emotion node information and the emotion association information to obtain emotion category information; performs emotion recognition based on the emotion category information and the keyword emotion intensity values to obtain emotion recognition results. This effectively realizes accurate and effective recognition of emotions in the customer communication process.
[0084] Continue to refer Figure 3 In some optional implementations of this embodiment, step S10 includes the following steps:
[0085] Step S101, obtaining original communication information;
[0086] In this embodiment, the original communication information refers to the data and information generated during all the communication and interaction with the customer. The original communication information can exist through various channels and forms. The original communication information may include text messages: such as emails, text messages, social media private messages, online chat records, etc.; voice communication: voice communication in the form of telephone calls, voice chats, etc. The original communication information can be recorded and stored in the database by the system in real time, and extracted from the database.
[0087] Step S102, performing non-standard information identification on the original communication information to obtain non-standard communication information;
[0088] In this embodiment, non-standard information refers to information with non-standard expressions such as common Internet terms, emoticons, kaomoji, and Chinese-English mixed sentences. Non-standard information can be identified through a pre-established non-standard information database. The steps for establishing the non-standard information database include: Data collection: Collect text data containing non-standard information from various online communication channels (such as social media, forums, chat applications, etc.). This data should be as extensive and diverse as possible to cover non-standard information in different fields and contexts; Data cleaning: Clean the collected data to remove irrelevant information, noise, and duplicates. Ensuring the quality and accuracy of the data is crucial for subsequent information database construction; Information extraction: Extract non-standard information from the cleaned data, including common Internet terms, emoticons, kaomoji, Chinese-English mixed sentences, etc. This information should be organized into a structured form for easy subsequent querying and matching. Index establishment: To improve query efficiency, an index can be established for the non-standard information database. The index can be constructed based on keywords, phrases, or specific patterns to quickly locate relevant non-standard information during the identification process.
[0089] Step S103, perform standardization processing on the non-standard communication information to obtain standard communication information;
[0090] In this embodiment, the standardization processing includes Emoticon conversion: Convert emoticons into corresponding text descriptions or emotion labels. For example, convert a smiling face emoticon into words such as "happy" or "satisfied"; Kaomoji conversion: Kaomoji are usually composed of simple characters to express specific expressions or emotions, and they can be converted into corresponding text descriptions or emotion labels; Internet term substitution: For common Internet terms, more standard words or phrases can be used for substitution. For example, substitute "chaoji" with "super", and "zenmeban" with "zen me ban" (how to do); Chinese-English mixed sentence splitting: For Chinese-English mixed sentences, they can be split into independent Chinese and English parts according to the context, or be translated as a whole to form a standard expression.
[0091] Step S104, update the original communication information according to the standard communication information to obtain the customer communication information.
[0092] In this embodiment, the original communication information is updated by replacing the sentence information corresponding to the standard communication information in the original communication information. In this embodiment, when obtaining non-standard communication information, the information position of the non-standard communication information in the original communication information will be recorded. After converting the non-standard communication information into standard communication information, the original communication information is overwritten and replaced according to this information position to obtain the customer communication information.
[0093] In this embodiment, the original communication information is obtained; the non-standard information in the original communication information is identified to obtain non-standard communication information; the non-standard communication information is standardized to obtain standard communication information; and the original communication information is updated according to the standard communication information, so as to effectively obtain the customer communication information obtained by standardizing the original communication information recorded during the communication with the customer, which is convenient for subsequent key information extraction and processing.
[0094] In some optional implementation manners of this embodiment, before step S20, the following steps are further included:
[0095] Obtain sample communication information;
[0096] In this embodiment, the sample communication information is an information dataset selected from historical customer communication information. This sample communication information has diversity and can effectively cover different topics, emotional tendencies, and expression ways.
[0097] Preprocess the sample communication information to obtain standard sample communication information;
[0098] In this embodiment, the preprocessing includes text cleaning: removing irrelevant information such as HTML tags, special characters, and duplicates; word segmentation: splitting the text into lexical or phrase units, which depends on the language used and the characteristics of the processor; part-of-speech tagging: tagging the part of speech for each word or phrase after word segmentation for subsequent analysis; standardization: replacing non-standard words (such as Internet terms, abbreviations, etc.) with standard words, or unifying the format using regular expressions, etc.; stop word removal: removing high-frequency but meaningless words in the text, such as "de" (的), "le" (了), etc.
[0099] Perform keyword tagging on the standard sample communication information to obtain sample communication keywords;
[0100] In this embodiment, keyword tagging of the standard sample communication information can be performed manually or by model recognition. The model recognition method can use a Transformer model based on the self-attention mechanism, such as BERT, to perform automatic recognition through the Transformer model, thereby improving the efficiency of keyword tagging.
[0101] Quantify the emotional intensity according to the sample communication keywords to obtain the sample keyword emotional intensity value;
[0102] In this embodiment, the emotional intensity of the sample communication keywords can be quantified by using a sentiment analysis tool. The sentiment analysis tool can be Sysomos, Backtype, MoodViews, etc. The emotional intensity can be quantified by comparing the intensity of the sentiment words in the text with a baseline value based on the concept of the Emotion Intensity Index (EI index).
[0103] The preset natural language processing model is trained according to the sample communication keywords and the sample keyword emotion intensity values to obtain the key information extraction model.
[0104] In this embodiment, the preset natural language processing model adopts the BERT model, which assigns a label to each word in each sample communication information, points the label to whether the word is a sample communication keyword and the corresponding sample keyword emotion intensity value, and then sets a multi-task learning method to simultaneously optimize two goals during the training process: one is the accuracy of keyword extraction, and the other is the accuracy of emotion intensity quantification. On the basis of the BERT model, a fully connected layer is added to predict whether each word is a keyword, and another layer is added to predict the emotion intensity of the keyword, and a suitable loss function is designed to simultaneously consider the accuracy of keyword extraction and emotion intensity quantification, and the sample communication keywords and sample keyword emotion intensity values are used to train the BERT that performs the above processing, and the model is evaluated and optimized after training, so as to obtain a key information extraction model.
[0105] This embodiment obtains sample communication information; pre-processes the sample communication information to obtain standard sample communication information; performs keyword annotation on the standard sample communication information to obtain sample communication keywords; quantifies the emotion intensity according to the sample communication keywords to obtain sample keyword emotion intensity values; trains a preset natural language processing model according to the sample communication keywords and the sample keyword emotion intensity values, thereby effectively training the natural language processing model through the sample communication information to obtain a key information extraction model that can accurately extract key information, so as to facilitate subsequent key information extraction processing of customer communication information.
[0106] In some optional implementations of this embodiment, generating emotion node information and emotion association information according to the customer communication keywords and the keyword emotion intensity values includes the following steps:
[0107] Obtaining a preset emotion category, and generating a first emotion node according to the emotion category;
[0108] In this embodiment, the emotion categories include: happiness, sadness, anger, surprise, etc. By defining the emotion categories and then creating a corresponding first emotion node for each emotion category, the first emotion node is generated according to the emotion category.
[0109] Correspondingly associating the customer communication keyword with the keyword emotion intensity value to generate a second emotion node;
[0110] In this embodiment, the customer communication keywords in each customer communication information are obtained, and at the same time, an emotion intensity value is assigned to each customer communication keyword, thereby forming a second emotion node, which not only includes the keyword itself, but also includes the emotion intensity information related thereto.
[0111] Generate the emotion node information according to the first emotion node and the second emotion node;
[0112] In this embodiment, complete emotion node information is formed by combining the first emotion node (preset emotion category) and the second emotion node (keywords in customer communication and their emotional intensity). The combining step can be achieved by classifying the second emotion node under the closest first emotion node, or by keeping them as independent nodes but establishing clear associations.
[0113] Acquiring sequence information of the customer communication keywords, and sequentially connecting the customer communication keywords according to the sequence information to obtain a first emotion association relationship;
[0114] In this embodiment, the sequence information refers to the order in which customer communication keywords (second emotional nodes) appear in customer communication information. Customer communication keywords are connected in order based on the sequence information, thereby forming a first emotional association relationship that reflects the logical order of the customer's emotional expression during the communication process.
[0115] Correspondingly associating the customer communication keyword with the emotion category according to the keyword emotion intensity value to obtain a second emotion association relationship;
[0116] In this embodiment, the second emotion association relationship is an emotion intensity association relationship, which is obtained by directly associating each customer communication keyword (second emotion node) with the most suitable emotion category (first emotion node) according to its emotion intensity value. The second emotion association relationship is a direct mapping based on emotion intensity, and the matching emotion category can be determined according to a threshold judgment or a classification algorithm.
[0117] The emotion association information is generated according to the first emotion association relationship and the second emotion association relationship.
[0118] In this embodiment, the final emotion association information is generated by integrating the first emotion association relationship (based on order) and the second emotion association relationship (based on emotion intensity). The emotion association information not only includes the order of keywords in customer communication, but also reflects the emotions expressed by these keywords and their intensity and their association with preset emotion categories.
[0119] This embodiment obtains a preset emotion category, generates a first emotion node according to the emotion category; associates the customer communication keyword with the keyword emotion intensity value to generate a second emotion node; generates the emotion node information according to the first emotion node and the second emotion node; obtains the sequence information of the customer communication keyword, sequentially connects the customer communication keywords according to the sequence information to obtain a first emotion association relationship; associates the customer communication keyword with the emotion category according to the keyword emotion intensity value to obtain a second emotion association relationship; generates the emotion association information according to the first emotion association relationship and the second emotion association relationship. In this way, the emotion node information and emotion association information of each emotion node and each emotion association relationship are effectively obtained to facilitate the subsequent emotion classification processing.
[0120] Continue to refer Figure 4 In some optional implementations of this embodiment, step S40 includes the following steps:
[0121] Step S401, calculating an emotion category score according to the emotion node information and the emotion association information;
[0122] In this embodiment, the step of calculating the emotion category score includes accumulating the emotion intensity of keywords: for each emotion category, accumulating the emotion intensity values of keywords belonging to the category (or highly related thereto), which can be achieved by traversing the second emotion node and checking their association with the first emotion node; emotion weighting: obtaining preset weights of different emotion categories, and performing weighted calculation based on the weights and the accumulated emotion intensity values of the emotion categories, thereby obtaining the emotion category weighted scores corresponding to the emotion categories; normalization processing: normalizing the emotion category weighted scores, by dividing the score of each category by the sum of the scores of all categories, thereby obtaining a standard normalized emotion category score.
[0123] Step S402, obtaining an emotion threshold corresponding to the emotion category score;
[0124] In this embodiment, the emotion threshold refers to the boundary value used to determine the attribution of an emotion category. The emotion threshold can be a preset value dynamically generated based on historical data or a training model. The steps of generating the emotion threshold based on historical data include data collection: obtaining a historical communication data set with emotion labels; feature extraction: extracting emotion-related features from the collected historical communication data set, such as keywords, phrases, emotional vocabulary matching, emotional dictionary scores, etc.; statistical analysis: for each emotion category, statistically calculating the average, median, standard deviation and other statistics of the corresponding features; threshold setting: setting the emotion threshold based on the results of statistical analysis. For example, the median or average score of a certain emotion category plus a standard deviation can be used as the threshold of the category.
[0125] Step S403: performing emotion classification according to the emotion category score and the emotion threshold to obtain the emotion category information.
[0126] In this embodiment, the emotion category information includes information such as the primary emotion category, the secondary emotion category, and the corresponding emotion category score. The emotion category is determined by comparing the emotion category score with the emotion threshold. When the score of a category exceeds its emotion threshold, the category is regarded as the primary emotion category. If the scores of multiple categories exceed their respective emotion thresholds, the emotion category with the highest score needs to be selected as the primary emotion category. The remaining emotion categories that exceed the emotion threshold are regarded as secondary emotion categories.
[0127] This embodiment calculates the emotion category score according to the emotion node information and the emotion association information; obtains the emotion threshold corresponding to the emotion category score; and classifies the emotion according to the emotion category score and the emotion threshold, thereby effectively obtaining the emotion category information classified based on the emotion category score and the emotion threshold, so as to facilitate the subsequent emotion recognition processing.
[0128] Continue to refer Figure 5 In some optional implementations of this embodiment, step S401 includes the following steps:
[0129] Step S4011, obtaining preset parameter information;
[0130] In this embodiment, the preset parameter information is parameter information used to construct the emotion change graph, including configuration options for graph construction (such as color, legend, axis label, etc.) and emotion node definitions.
[0131] Step S4012, constructing a graph according to the preset parameter information, the emotion node information, and the emotion association information to obtain an emotion change graph;
[0132] In this embodiment, the nodes are organized by emotion node information (i.e., words, phrases or sentences expressing emotions) and emotion association information (such as the logical relationship between emotion nodes, time sequence, etc.), and then these emotion nodes and their associated information are plotted into a chart according to preset chart construction parameters to form an emotion change chart, which intuitively shows the changes in customer emotions with the communication process.
[0133] Step S4013, acquiring emotion change trend information based on the emotion change graph;
[0134] In this embodiment, after the emotion change graph is constructed, the trend information of emotion change (including the ups and downs, peaks and troughs of emotion, frequency of emotion conversion, etc.) is extracted by analyzing the data in the graph, thereby effectively obtaining the emotion change trend information.
[0135] Step S4014, converting the customer communication information into a communication information vector, and inputting the emotion change trend information and the communication information vector into a pre-trained emotion evaluation model to obtain the emotion category score.
[0136] In this embodiment, the pre-trained emotion evaluation model can adopt a convolutional neural network model, by obtaining sample annotation data including different emotion categories, and then setting different convolution layers, pooling layers, and activation functions of the convolutional neural network model, and performing model training according to the sample annotation data, and performing model evaluation and optimization according to the verification annotation data set, thereby obtaining a pre-trained emotion evaluation model. The communication information vector includes various features of the customer's communication content, such as vocabulary frequency, sentiment word score, sentence structure, etc. By combining the communication information vector with the acquired emotion change trend information, and inputting it into the pre-trained emotion evaluation model as input data, the emotion category score corresponding to the customer's communication information can be effectively obtained.
[0137] This embodiment obtains preset parameter information; constructs a graph based on the preset parameter information, the emotion node information, and the emotion association information to obtain a mood change graph; obtains mood change trend information based on the mood change graph; converts the customer communication information into a communication information vector, and inputs the mood change trend information and the communication information vector into a pre-trained mood evaluation model, thereby effectively obtaining an emotion category score based on the emotion change graph and the emotion change trend for analysis and evaluation, to facilitate subsequent emotion classification processing.
[0138] Continue to refer Figure 6 In some optional implementations of this embodiment, step S50 includes the following steps:
[0139] Step S501, performing weighted calculation according to the emotion category information and the keyword emotion intensity value to obtain the emotion category intensity value;
[0140] In this embodiment, different weights are assigned to the communication keywords in each emotion category information. The weights can be set according to the expression importance and frequency of the keywords in the emotion category. In this embodiment, the calculation formula of the emotion category strength value is: Among them, i represents the emotion category, j represents the keyword index under this category, and n is the total number of keywords under this category.
[0141] Step S502, mapping the emotion category intensity value to a preset emotion level table to obtain the emotion category level;
[0142] In this embodiment, the emotion level table is a predefined information table, which contains five levels of emotion levels corresponding to each emotion category, ranging from "very weak" to "very strong", wherein each level corresponds to an intensity value range, and the corresponding emotion category level is found by comparing the calculated emotion category intensity value with the range in the emotion level table.
[0143] Step S503: taking the emotion category level as the emotion recognition result.
[0144] In this embodiment, the emotion category level that is mapped and matched is sent to a preset display interface as an emotion recognition result to complete the output of the emotion recognition result, thereby further helping business customer service personnel to perform effective customer emotion recognition.
[0145] This embodiment performs weighted calculation based on the emotion category information and the keyword emotion intensity value to obtain the emotion category intensity value; maps the emotion category intensity value to a preset emotion level table to obtain the emotion category level; and uses the emotion category level as the emotion recognition result. Thus, an emotion recognition result that is accurately identified based on the emotion category information and the keyword emotion intensity value is effectively obtained.
[0146] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0147] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0148] Further references Figure 7 , as a response to the above Figure 1 The present application provides an embodiment of an emotion recognition device, and the embodiment of the device is Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0149] like Figure 7 As shown, the emotion recognition device 600 described in this embodiment includes: an information acquisition module 601, an information extraction module 602, an information generation module 603, an information classification module 604, and a result recognition module 605. Among them:
[0150] Information acquisition module 601, used to acquire customer communication information;
[0151] An information extraction module 602 is used to input the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values;
[0152] Information generation module 603, used to generate emotion node information and emotion association information according to the customer communication keywords and the keyword emotion intensity values;
[0153] An information classification module 604 is used to classify emotions based on the emotion node information and the emotion association information to obtain emotion category information;
[0154] The result recognition module 605 is used to perform emotion recognition according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result.
[0155] By adopting the above-mentioned emotion recognition device, this embodiment can obtain customer communication information; input the customer communication information into the pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; generate emotion node information and emotion association information based on the customer communication keywords and the keyword emotion intensity values; perform emotion classification based on the emotion node information and the emotion association information to obtain emotion category information; perform emotion recognition based on the emotion category information and the keyword emotion intensity values to obtain emotion recognition results. This effectively realizes accurate and effective recognition of emotions in the customer communication process.
[0156] To solve the above technical problems, the present application also provides a computer device. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.
[0157] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 7 with components 71-73, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0158] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0159] The memory 71 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the computer device 7, such as a hard disk or memory of the computer device 7. In other embodiments, the memory 71 can also be an external storage device of the computer device 7, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 7. Of course, the memory 71 can also include both the internal storage unit of the computer device 7 and its external storage device. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as computer-readable instructions of the emotion recognition method, etc. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or are to be output.
[0160] The processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to run computer-readable instructions or process data stored in the memory 71, such as computer-readable instructions for running the emotion recognition method.
[0161] The network interface 73 may include a wireless network interface or a wired network interface. The network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0162] By adopting the above-mentioned computer device, this embodiment can obtain customer communication information; input the customer communication information into the pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; generate emotion node information and emotion association information based on the customer communication keywords and the keyword emotion intensity values; perform emotion classification based on the emotion node information and the emotion association information to obtain emotion category information; perform emotion recognition based on the emotion category information and the keyword emotion intensity values to obtain emotion recognition results. This effectively realizes accurate and effective recognition of emotions in the customer communication process.
[0163] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the emotion recognition method as described above.
[0164] By adopting the above-mentioned computer-readable storage medium, this embodiment can obtain customer communication information; input the customer communication information into the pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; generate emotion node information and emotion association information based on the customer communication keywords and the keyword emotion intensity values; perform emotion classification based on the emotion node information and the emotion association information to obtain emotion category information; perform emotion recognition based on the emotion category information and the keyword emotion intensity values to obtain emotion recognition results. This effectively realizes accurate and effective recognition of emotions in the customer communication process.
[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0166] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. An emotion recognition method, characterized in that: The steps include: Obtain customer communication information; Inputting the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; Generate emotional node information and emotional association information according to the customer communication keywords and the keyword emotional intensity values; Performing emotion classification based on the emotion node information and the emotion association information to obtain emotion category information; Emotion recognition is performed according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result.
2. The emotion recognition method according to claim 1, characterized in that: The steps of obtaining customer communication information specifically include: Obtain original communication information; Performing non-standard information identification on the original communication information to obtain non-standard communication information; Standardizing the non-standard communication information to obtain standard communication information; The original communication information is updated according to the standard communication information to obtain the customer communication information.
3. The emotion recognition method according to claim 1, characterized in that: Before the step of inputting the customer communication information into the pre-trained key information extraction model to obtain the customer communication keywords and keyword emotion intensity values, the following steps are also included: Obtain sample communication information; Preprocessing the sample communication information to obtain standard sample communication information; Perform keyword tagging on the standard sample communication information to obtain sample communication keywords; quantifying the emotional intensity of the sample communication keywords to obtain the emotional intensity value of the sample keywords; The preset natural language processing model is trained according to the sample communication keywords and the sample keyword emotion intensity values to obtain the key information extraction model.
4. The emotion recognition method according to claim 1, characterized in that: The step of generating emotion node information and emotion association information according to the customer communication keywords and the keyword emotion intensity values specifically includes: Obtaining a preset emotion category, and generating a first emotion node according to the emotion category; Correspondingly associating the customer communication keyword with the keyword emotion intensity value to generate a second emotion node; Generate the emotion node information according to the first emotion node and the second emotion node; Acquiring sequence information of the customer communication keywords, and sequentially connecting the customer communication keywords according to the sequence information to obtain a first emotion association relationship; Correspondingly associating the customer communication keyword with the emotion category according to the keyword emotion intensity value to obtain a second emotion association relationship; The emotion association information is generated according to the first emotion association relationship and the second emotion association relationship.
5. The emotion recognition method according to claim 1, characterized in that: The step of performing emotion classification based on the emotion node information and the emotion association information to obtain emotion category information specifically includes: Calculate an emotion category score according to the emotion node information and the emotion association information; Obtaining an emotion threshold corresponding to the emotion category score; Emotion classification is performed according to the emotion category score and the emotion threshold to obtain the emotion category information.
6. The emotion recognition method according to claim 5, characterized in that: The step of calculating the emotion category score according to the emotion node information and the emotion association information specifically includes: Get preset parameter information; Constructing a graph according to the preset parameter information, the emotion node information, and the emotion association information to obtain an emotion change graph; Acquiring emotion change trend information based on the emotion change graph; The customer communication information is converted into a communication information vector, and the emotion change trend information and the communication information vector are input into a pre-trained emotion evaluation model to obtain the emotion category score.
7. The emotion recognition method according to claim 1, characterized in that: The step of performing emotion recognition according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result specifically includes: Performing weighted calculation according to the emotion category information and the keyword emotion intensity value to obtain an emotion category intensity value; Mapping the emotion category intensity value to a preset emotion level table to obtain the emotion category level; The emotion category level is used as the emotion recognition result.
8. An emotion recognition device, characterized in that: include: Information acquisition module, used to obtain customer communication information; An information extraction module, used for inputting the customer communication information into a pre-trained key information extraction model to obtain customer communication keywords and keyword emotion intensity values; An information generation module, used to generate emotion node information and emotion association information according to the customer communication keywords and the keyword emotion intensity values; An information classification module, used to classify emotions based on the emotion node information and the emotion association information to obtain emotion category information; The result recognition module is used to perform emotion recognition according to the emotion category information and the keyword emotion intensity value to obtain an emotion recognition result.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the emotion recognition method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the emotion recognition method according to any one of claims 1 to 7 are implemented.