A customer demand sentiment analysis method based on convolutional neural network
By clustering keywords and sentences of historical communication records, obtaining emotional weights and multi-context feature parameters, determining receptive field demand parameters and training neural network models, the problem of poor performance of convolutional neural network models on new data is solved, and the accuracy of customer appeal emotion analysis is improved.
Patent Information
- Application Number
- CN202410999377.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The existing convolutional neural network model performs well on training data, but does not perform well on new data, resulting in inaccurate analysis of customer appeals.
By obtaining the text data of the preprocessed historical communication records, keyword clustering and sentence clustering are performed, the emotional weight of each keyword and multi-context characteristic parameters of each appeal statement are obtained, the receptive field demand parameters of each appeal statement are determined, and the neural network model is trained for customer appeal emotion analysis.
It improves the accuracy of neural network models for customer appeals, can better capture context changes and emotional states, avoid the problem of model overfitting, and enhances the ability to purify and learn customers' real emotions.
Smart Images

Figure CN118779432B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a customer demand sentiment analysis method based on convolutional neural network. Background Art
[0002] Sentiment analysis of customer complaints by customer service is of great significance to related companies in improving service quality, enhancing customer satisfaction and optimizing operation management. Currently, based on deep learning algorithms and natural language processing technology, customer language characteristics are analyzed, communication content is automatically classified, inferred, and generated to accurately understand customer needs.
[0003] The advantage of using Convolutional Neural Network (CNN) for sentiment analysis is that it can automatically extract complex features from text and performs well when processing large amounts of text data. However, CNN models often perform well on training data but poorly on new data. This may be because different customers express their emotions in different ways, with complex and changing contextual information. CNN focuses too much on local features in the learning process of customer demands and is unable to purify and learn the real emotions of customers. Blindly changing the receptive field of the CNN learning process may also cause noise problems, leading to overfitting of the model and inability to accurately analyze customer demand sentiment. Summary of the invention
[0004] In order to solve the technical problem that the unreasonable setting of receptive field parameters in the existing neural network leads to inaccurate sentiment analysis of customer demands, the purpose of the present invention is to provide a customer demand sentiment analysis method based on a convolutional neural network. The technical solution adopted is as follows:
[0005] A method for analyzing customer demand sentiment based on convolutional neural network, the method comprising:
[0006] Acquire the pre-processed text data of the historical communication records; the text data at least includes the customer's appeal statement and the customer service's reply statement; the same keywords in the appeal statement are regarded as a category of keywords;
[0007] Cluster the reply sentences to obtain reply clusters; cluster the appeal sentences to obtain appeal clusters; obtain the sentiment weight of each type of keyword based on the quantity characteristics of the reply sentences in each reply cluster and the distribution characteristics of each type of keyword; obtain the multi-context feature parameters of each appeal sentence based on the distribution characteristics of the reply sentences corresponding to the appeal sentences in each appeal cluster; obtain the receptive field requirement parameters of each appeal sentence based on the changes in the sentiment weights of the keywords in the consecutive appeal sentences and the multi-context feature parameters;
[0008] According to the receptive field requirement parameters of each appeal sentence and in combination with the sentiment weights of the keywords in adjacent appeal sentences, the receptive field of each appeal sentence is determined and a neural network is trained; the sentiment of the customer appeal is analyzed based on the trained neural network model.
[0009] Furthermore, the method for obtaining the reply cluster includes:
[0010] Each of the reply statements is converted into a vector representation, and similar features between the corresponding vectors of the reply statements are analyzed to obtain the clustering distance between the reply statements; all the reply statements are clustered based on the clustering distance to obtain the reply cluster cluster.
[0011] Furthermore, the method for obtaining the sentiment weight includes:
[0012] Select any keyword as the target keyword;
[0013] According to the number of the reply sentences in each of the reply clusters, a first emotion parameter of each of the reply clusters is obtained; the number of the reply sentences in each of the reply clusters is negatively correlated with the first emotion parameter;
[0014] In all the appeal sentences corresponding to all the reply sentences in each of the reply clusters, the probability of the target keyword appearing is obtained as a second sentiment parameter corresponding to each of the reply clusters and the target keyword;
[0015] The sentiment weight of the target class keyword is obtained according to the first sentiment parameter and the second sentiment parameter corresponding to the target class keyword and all the reply clusters; the first sentiment parameter and the second sentiment parameter are both positively correlated with the sentiment weight.
[0016] Furthermore, the method for acquiring the multi-context feature parameters includes:
[0017] Obtain the reply statements corresponding to all the demand statements in the demand clustering cluster, and their distribution probability in each of the reply clustering clusters; analyze the distribution discrete features of all the reply statements corresponding to each of the demand clustering clusters based on all the distribution probabilities corresponding to each of the demand clustering clusters, and obtain the multi-context feature parameters of each of the demand statements; the distribution discrete features are positively correlated with the multi-context feature parameters.
[0018] Furthermore, the method for obtaining the receptive field requirement parameter includes:
[0019] Obtaining the context transition probability according to the difference characteristics of the sentiment weights of all keywords in each appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence; the context transition probability is positively correlated with the sentiment weights of all keywords in the current appeal sentence;
[0020] According to the multi-context feature parameters of each appeal sentence and the appeal sentence adjacent to the appeal sentence in the negative direction of the time sequence, the polysemy probability of each appeal sentence is obtained; the multi-context feature parameters of the appeal sentence and the appeal sentence adjacent to the negative direction of the time sequence are all positively correlated with the polysemy probability;
[0021] According to the context transition probability and the polysemy probability corresponding to each appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence, combined with the multi-context feature parameters of each appeal sentence, the receptive field requirement parameters of each appeal sentence are obtained; the context transition probability, the polysemy probability and the multi-context feature parameters are all positively correlated with the receptive field requirement parameters.
[0022] Furthermore, the method for obtaining the receptive field includes:
[0023] According to the receptive field requirement parameter of each appeal sentence, combined with the sentiment weight of the key words in the appeal sentence adjacent to each other in the negative direction of the time sequence, an objective function is constructed; and the receptive field of each appeal sentence is determined according to the objective function.
[0024] Furthermore, the method for obtaining the objective function includes:
[0025] Using the sentiment weights of all the keywords in the current appeal sentence, normalizing the sentiment weight of each keyword in the appeal sentence adjacent in the negative direction of the time sequence, to obtain a modified sentiment weight;
[0026] Any number of keywords are randomly selected from the appeal statements that are adjacent in the negative direction of the current appeal statement in time sequence, and an objective function is constructed based on the difference between the modified sentiment weights of all the selected keywords and the receptive field requirement parameters of the current appeal statement; the difference between the modified sentiment weights of all the selected keywords and the receptive field requirement parameters of the current appeal statement is positively correlated with the objective function.
[0027] Furthermore, when the objective function converges to a minimum, the selected keywords serve as the receptive field of the current appeal sentence.
[0028] Furthermore, the objective function also includes a penalty term; the penalty term is positively correlated with the number of selected keywords.
[0029] Furthermore, the method for obtaining the cluster distance includes:
[0030] According to the cosine similarity between two vectors corresponding to any two reply statements, the cluster distance corresponding to the two reply statements is obtained; the cosine similarity is negatively correlated with the cluster distance.
[0031] The present invention has the following beneficial effects:
[0032] The present invention first obtains the text data of the historical communication records after preprocessing, and takes the same keywords in the appeal sentences as a category of keywords, providing a basis for the subsequent analysis process; further clusters the reply sentences to obtain reply clustering clusters, so as to analyze the same appeal purpose of different customers through the category of reply sentences and more accurately analyze the emotional characteristics of users; further clusters the appeal sentences to obtain appeal clustering clusters, so as to facilitate the subsequent analysis of the multi-context characteristics of similar appeal sentences in the same clustering cluster; further obtains the emotional weight of each category of keywords, characterizes the emotional value of each category of keywords, and is more conducive to analyzing the emotional information in the customer's appeal sentences; further obtains the multi-context feature parameters of each appeal sentence, characterizes the multi-context characteristics of the appeal sentence, and is convenient for more delicate analysis of the customer's appeal emotional information; further obtains the receptive field requirement parameters of each appeal sentence, represents the receptive field requirement characteristics of each appeal sentence, and provides a basis for the subsequent establishment of the applicable receptive field of each appeal sentence; further determines the receptive field of each appeal sentence and trains the neural network, so that the receptive field parameter setting of the neural network training process is more suitable for the current application scenario, and the trained neural network model can better capture the user's appeal emotional information; finally, the customer's appeal emotion is analyzed based on the trained neural network model. The present invention establishes a suitable receptive field by analyzing the contextual changes and emotional weights of customer demands, thereby avoiding the problem that the neural network model pays too much attention to local features in the learning process of customer demands, and is unable to purify and learn the real emotions of customers. Blindly changing the receptive field of the neural network model learning process may cause noise problems and lead to overfitting of the model. The real emotions of customers in more complex customer communication texts can be purified and learned, thereby improving the accuracy of the neural network's emotional analysis of customer demands, and is more conducive to improving customer service communication efficiency, improving customer satisfaction and optimizing service processes. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A flowchart of a method for analyzing customer demand sentiment based on a convolutional neural network provided by an embodiment of the present invention;
[0035] Figure 2 A flow chart of a method for obtaining a sentiment weight provided by an embodiment of the present invention;
[0036] Figure 3A flow chart of a method for obtaining receptive field requirement parameters provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a customer demand sentiment analysis method based on a convolutional neural network proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0038] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0039] The following is a detailed description of a method for analyzing customer demand sentiment based on a convolutional neural network provided by the present invention in conjunction with the accompanying drawings.
[0040] See also Figure 1 , which shows a flow chart of a method for analyzing customer demand sentiment based on a convolutional neural network provided by an embodiment of the present invention, specifically comprising:
[0041] Step S1: obtaining the pre-processed text data of the historical communication records; the text data at least includes the customer's request statement and the customer service's reply statement; the same keywords in the request statement are regarded as a category of keywords.
[0042] In an embodiment of the present invention, an embodiment scenario is a scenario of customer demands of an electric power company and responses from electric power customer service. First, the historical communication records received by the electric power customer service are converted into text form. The historical communication records come from multiple channels such as telephone recordings, online chat records, emails, and social media interactions. The preprocessing process at least includes: cleaning the communication data, removing irrelevant characters, such as punctuation marks, numbers, etc.; decomposing the text into words or phrases, removing stop words, that is, common words that do not carry important information in text analysis, such as: of, is, in; then stemming or word form restoration is performed to reduce different forms of words to their basic form, and obtain the text data of the preprocessed historical communication records. The same keywords in the demand sentence are regarded as a category of keywords, which facilitates the subsequent analysis of different categories of customer demand keywords.
[0043] It should be noted that each customer communication record is a communication sequence consisting of the customer's demand text and the power customer service reply text in order. Each utterance of the customer text in the communication sequence is called a demand sentence, and each utterance of the corresponding power customer service reply text in the communication sequence is called a reply sentence. It is considered that each reply sentence corresponds to the demand sentence adjacent to it in the reverse direction of the time sequence in the communication sequence.
[0044] Step S2: Cluster the reply sentences to obtain reply clusters; cluster the appeal sentences to obtain appeal clusters; obtain the sentiment weight of each type of keyword based on the quantity characteristics of the reply sentences in each reply cluster and the distribution characteristics of each type of keyword; obtain the multi-context feature parameters of each appeal sentence based on the distribution characteristics of the reply sentences corresponding to the appeal sentences in each appeal cluster; obtain the receptive field requirement parameters of each appeal sentence based on the changes in the sentiment weights of the keywords of consecutive appeal sentences and the multi-context feature parameters.
[0045] Considering that customer service reply texts have certain standards, customer service staff usually use pre-set scripts or templates to answer customer questions. Therefore, the reply statements are classified first to facilitate the analysis of the same demands of different customers through the categories of reply statements, and more accurate analysis of users' emotional characteristics.
[0046] Preferably, in one embodiment of the present invention, considering that the similar features between reply statements cannot be directly measured, each reply statement is first converted into a vector representation through text vectorization, so as to analyze the similar features between the corresponding vectors of the reply statements and obtain the clustering distance between the reply statements; all reply statements are clustered based on the clustering distance to obtain reply cluster clusters.
[0047] Commonly used text vectorization conversion methods in the prior art include the bag-of-words model, term frequency-inverse document frequency (TF-IDF), etc. As an example, the bag-of-words model is used for conversion. In other embodiments of the present invention, the implementer may also use term frequency-inverse document frequency and other methods to vectorize the text. These are all technical means well known to those skilled in the art and will not be described in detail here.
[0048] Preferably, in one embodiment of the present invention, considering that cosine similarity can measure the similarity features between vectors, the calculation is simple and efficient, so the cluster distance of the corresponding two reply statements is obtained according to the cosine similarity between the two vectors corresponding to any two reply statements; and because the larger the cosine similarity, the more obvious the similarity features between the two vectors, the smaller the difference between the corresponding two reply statements, and the more they need to be classified into the same cluster cluster, so the cosine similarity is negatively correlated with the cluster distance. As an example, the cosine similarity is substituted into the exp(-x) function for negative correlation mapping, where exp(-x) is an exponential function with the natural constant e as the base, and x is the independent variable.
[0049] After obtaining the cluster distance between the reply statements, clustering operation can be performed. As an example, the K-means clustering algorithm is used to classify all reply statements to obtain reply clusters.
[0050] It should be noted that in other embodiments of the present invention, the implementer may also use the Jaccard similarity coefficient or other methods to analyze the similarity features between the vectors corresponding to the reply statements, or use other negative correlation mapping functions to obtain the clustering distance; or may use a hierarchical clustering method for clustering, which are all technical means well known to those skilled in the art and will not be elaborated here.
[0051] Taking into account that for the same appeal purpose, the appeal descriptions of different customers have certain similarities, clustering the appeal sentences makes it easier to analyze different expressions of the same appeal purpose, and is more conducive to analyzing the emotional characteristics of customer appeals and the emotional changes in the appeal process. Therefore, the appeal sentences are clustered to obtain appeal clusters.
[0052] It should be noted that the method for obtaining the demand clustering clusters is similar to the method for obtaining the reply clustering clusters. The similarity between vectors is analyzed after text vectorization to obtain the clustering distance and clustering, which will not be elaborated here.
[0053] Taking into account the different sentiment weights of keywords in the appeal statement, some keywords represent obvious emotional changes in customers and contain more obvious emotional information, which is more important for analyzing the emotions of customers' appeals, so the sentiment weight of each type of keyword is analyzed.
[0054] Taking into account that the quantity characteristics of the reply sentences in the reply cluster reflect the regularity of the customer service's reply, it can indirectly confirm the emotional information of the customer's demands; considering that the distribution of keywords also reflects the customer's emotional information, the emotional weight of each type of keyword is obtained based on the quantity characteristics of the reply sentences in each reply cluster and the distribution characteristics of each type of keyword.
[0055] Preferably, in one embodiment of the present invention, the method of acquiring the sentiment weight includes:
[0056] See also Figure 2 , which shows a flow chart of a method for obtaining a sentiment weight provided by an embodiment of the present invention, specifically comprising:
[0057] Step S201: Select any type of keyword as a target keyword.
[0058] First, select any category of keywords as the target keywords to facilitate the analysis of the keywords category by category.
[0059] Step S202: Obtain a first sentiment parameter of each reply cluster according to the number of reply sentences in each reply cluster; the number of reply sentences in each reply cluster is negatively correlated with the first sentiment parameter.
[0060] Considering that the more reply sentences in the reply cluster, the more conventional and standardized the customer service replies in the reply cluster, which in turn reflects that the replies are to conventional customer demands, or may also be ordinary dialogue sentences with weak demand information, the more likely the corresponding demand sentence is a conventional demand, and the weaker the customer's emotional characteristics. For example, for conventional demands to inquire about electricity bills, customers usually do not show obvious emotions, and the reply sentences of power customer service are relatively fixed; on the contrary, the fewer reply sentences, the more likely it is a personalized demand, and the stronger the customer's emotional characteristics, such as power failures, power outages, and maintenance service complaints caused by various reasons; therefore, the number of reply sentences in each reply cluster is negatively correlated with the first emotional parameter.
[0061] As an example, the calculation method of the first sentiment parameter includes: performing negative correlation mapping and normalizing the ratio of the number of all reply statements in the reply cluster to the number of all reply statements in the text data, which can be D1 v =1-ρ v , where v represents the serial number of the reply cluster, ρ v represents the ratio of the number of all reply statements in the vth reply cluster to the number of all reply statements in the text data, D1 v represents the first sentiment parameter corresponding to the vth answer cluster. v The larger it is, the larger the number of all reply statements in the vth reply cluster is relative to the whole, reflecting that the reply cluster is more likely to be conventional, the corresponding customer demands are more conventional, the customer's emotional characteristics are weaker, and the smaller the first emotional parameter is.
[0062] As another example, the calculation method of the first emotion parameter may also be: D1 v =norm[exp (-γ v )], where v represents the serial number of the reply cluster, γv represents the number of all reply statements in the vth reply cluster, exp ( ) represents the exponential function with the natural constant e as the base, D1 v represents the first sentiment parameter corresponding to the vth answer cluster, and norm[ ] represents the standard normalization function. v The larger it is, the more reply statements there are in the vth reply cluster, which reflects that the reply cluster is more likely to be conventional, the corresponding customer demands are more conventional, the customer's emotional characteristics are weaker, the smaller the negative correlation is after normalization, and the smaller the first emotional parameter is.
[0063] Step S203: In all appeal sentences corresponding to all reply sentences in each reply cluster, the probability of the target class keyword appearing is obtained as the second emotion parameter corresponding to each reply cluster and the target class keyword.
[0064] Considering that the higher the probability of the target keywords appearing, the more frequently the target keywords appear, the higher the probability that customers use the target keywords to express their emotions, the more important the target keywords are, and the greater the emotional weight; and the first emotional parameter is obtained based on the reply clustering cluster, which is used to characterize the emotional feature strength of each reply clustering cluster, so it is necessary to obtain the characteristic parameters corresponding to each reply clustering cluster and the target keywords. Therefore, in all the appeal statements corresponding to all the reply statements in each reply clustering cluster, the probability of the target keywords appearing is obtained, which is convenient for the subsequent fusion of the first emotional parameter and the second emotional parameter to obtain a more representative emotional weight.
[0065] Step S204: Obtain the sentiment weight of the target keyword according to the first sentiment parameter and the second sentiment parameter corresponding to the target keyword and all the answer clusters; the first sentiment parameter and the second sentiment parameter are both positively correlated with the sentiment weight.
[0066] Considering that the first emotional parameter represents the intensity of the emotional characteristics of each reply cluster, the larger the first emotional parameter is, the fewer the number of reply sentences in the reply cluster, the more likely there is personalized appeal, and the stronger the customer's emotional characteristics are. At the same time, the second emotional parameter represents the probability of occurrence of the target class keywords corresponding to each reply cluster. The larger the second emotional parameter is, the higher the probability that the customer uses the target class keywords to express emotions, the more important the target class keywords are, and the greater the emotional weight. Based on this, the emotional weight of the target class keywords is obtained according to the first emotional parameters and second emotional parameters corresponding to the target class keywords and all reply clusters.
[0067] As an example, the calculation formula for the sentiment weight of the target keyword includes: Where v represents the serial number of the reply cluster, k represents the number of reply clusters, and s irepresents the sentiment weight of the i-th target keyword, D1 v represents the first sentiment parameter corresponding to the vth answer cluster, D2 i,v represents the second sentiment parameter corresponding to the i-th target keyword and the v-th answer cluster. v The larger it is, the stronger the customer's emotional characteristics are, and the greater the emotional weight of the target keyword is; D2 i,v The larger it is, the higher the probability that customers will use target keywords to express emotions. The more important the target keywords are, the greater the emotional weight is.
[0068] In other embodiments of the present invention, implementers may also use other positive correlation relationships to obtain the sentiment weight, for example, using a positive correlation mapping function such as a positive correlation exponential function to obtain the sentiment weight.
[0069] Considering that the same sentence may express very different emotional features, for example, "Do I need to do this?" can express both urgent inquiries and impatient questions; and "Are you sure?" can express both normal inquiries and distrustful doubts. Considering that the customer service reply statements will change according to different customer demands, the multi-context feature parameters of each demand statement can be obtained based on the distribution characteristics of the reply statements corresponding to the demand statements in each demand cluster.
[0070] Preferably, in one embodiment of the present invention, considering that in the demand clustering cluster where the demand statement is located, the more discrete the distribution of the reply statements corresponding to all the demand statements, and the less concentrated the distribution in all the reply clustering clusters, the more likely the demand statement is to have multi-context features. Based on this, the distribution probability of the reply statements corresponding to all the demand statements in the demand clustering cluster in each reply clustering cluster is obtained; according to all the distribution probabilities corresponding to each demand clustering cluster, the distribution discrete characteristics of all the reply statements corresponding to each demand clustering cluster are analyzed to obtain the multi-context feature parameters of each demand statement; the distribution discrete characteristics are positively correlated with the multi-context feature parameters.
[0071] As an example, the multi-context feature parameters are obtained by obtaining the kurtosis of the distribution probability, specifically including: Where exp[ ] represents an exponential function with the natural constant e as the base, v represents the serial number of the reply cluster, k represents the number of reply clusters, x represents the serial number of the appeal statement, and u x Represents the multi-context feature parameters of the x-th appeal statement, It represents the distribution probability of the reply statements corresponding to all the appeal statements in the appeal cluster where the x-th appeal statement is located in the v-th reply cluster, Represents the mean of all distribution probabilities corresponding to the demand clustering cluster where the x-th demand statement is located; Represents the standard deviation of all distribution probabilities corresponding to the demand cluster where the x-th demand statement is located; It represents the kurtosis of all distribution probabilities corresponding to the demand cluster where the x-th demand statement is located. In the formula, the smaller the kurtosis, the more discrete the distribution of the reply statements corresponding to all demand statements in the demand cluster where the current demand statement is located, the more obvious the distribution discrete feature, the less concentrated the distribution in all reply clusters, the more likely the demand statement is to have multi-context features, and the larger the multi-context feature parameter.
[0072] In other embodiments of the present invention, the implementer may also analyze the distribution discrete characteristics of the reply sentences corresponding to the demand clustering clusters in other ways. For example, the implementer may also obtain multi-context feature parameters in the form of information entropy. In the demand clustering cluster where the current demand sentence is located, the more discrete the distribution of reply sentences corresponding to all demand sentences, and the less concentrated the distribution in all reply clustering clusters, the greater the information entropy, and the greater the multi-context feature parameters. The method of calculating information entropy is a technical means well known to those skilled in the art and will not be elaborated here.
[0073] In an embodiment of the present invention, by expanding the receptive field, context changes and emotional states can be captured more comprehensively and accurately, so as to more effectively understand the customer's real demands and emotional states. At the same time, in order to avoid overfitting due to a large receptive field, the model may capture too much irrelevant information, resulting in information redundancy, and reducing the accuracy and robustness of the model. Therefore, the receptive field requirement parameters of each appeal sentence are obtained; considering that in addition to the situation where the semantics of the appeal sentence itself exist in multiple contexts, it is also necessary to analyze the context changes of the customer's consecutive appeal sentences, considering that the emotional weight of keywords reflects the emotional intensity characteristics of the customer's appeal sentences, the change in the emotional weight of keywords between consecutive appeal sentences can also reflect the context change. Therefore, according to the change in the emotional weight of keywords in consecutive appeal sentences, combined with the multi-context feature parameters, the receptive field requirement parameters of each appeal sentence are obtained.
[0074] Preferably, in one embodiment of the present invention, the method for obtaining the receptive field requirement parameter includes:
[0075] See also Figure 3 , which shows a flow chart of a method for obtaining a receptive field requirement parameter provided by an embodiment of the present invention, specifically comprising:
[0076] Step S301: Obtain the context transition probability according to the difference characteristics of the sentiment weights of all keywords in each appeal sentence and the appeal sentences adjacent to it in the negative direction of the time sequence.
[0077] Among them, the context transition probability is positively correlated with the sentiment weights of all keywords in the current appeal sentence.
[0078] Taking into account that when customers express personal demands, they are usually related to the previous statements of the customer, so we analyze the changes between each demand statement and the adjacent demand statements in the negative direction of time sequence; when the difference in the overall emotional weights of the keywords in the adjacent demand statements is greater, the more it indicates that the possibility of a turning point in the demand statement is greater, and the probability of contextual turning is greater; at the same time, considering that there is a contextual turning point in the customer's demand statement, the overall emotional weight of the current demand statement is usually greater than the overall emotional weight of the adjacent demand statement in the negative direction of time sequence. For example, when a customer is dissatisfied with the customer service's reply, the emotions such as anger or rage expressed fluctuate violently, and the dissatisfaction of the subsequent demand statements usually decays with the customer service's reply. Therefore, when the overall emotional weight of the current demand statement is less than the overall emotional weight of the adjacent demand statement in the negative direction of time sequence, it is a continuation of the previous context, and the probability of a contextual turning point is small.
[0079] As an example, the ratio of the average sentiment weight of all keywords in the current appeal statement to the average sentiment weight of all keywords in the appeal statement adjacent to it in the negative direction of time is taken as the context transition probability. The larger the ratio, the more sentiment weight the current appeal statement generates after the customer service reply, the greater the probability of a change in the customer context, and the greater the probability of a context transition.
[0080] As another example, the implementer may calculate the difference between the ratio of the average sentiment weight of all keywords of the current appeal sentence and the average sentiment weight of all keywords of the appeal sentence adjacent to the negative direction of the time sequence and 1, for example where μ x represents the mean sentiment weight of all keywords in the x-th appeal statement, μ x-1 represents the average sentiment weight of all keywords in the x-1th appeal statement, exp[] represents an exponential function with the natural constant e as the base, represents the context transition probability of the xth appeal sentence. The implementer can also directly compare the difference in the mean sentiment weight of all keywords in the appeal sentence, such as exp[μ x -μ x-1 ].
[0081] It should be noted that the context transition probability of the first appeal sentence defaults to 1; in other embodiments of the present invention, the implementer may also obtain a parameter that can represent the overall sentiment weight by weighting the sentiment weights of all keywords in each appeal sentence, thereby obtaining the context transition probability.
[0082] Step S302: Obtain the polysemy probability of each appeal sentence based on the multi-context feature parameters of each appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence; the multi-context feature parameters of the appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence are all positively correlated with the polysemy probability.
[0083] Considering that the larger the multi-context feature parameters of each demand statement are compared with the demand statements adjacent in the negative direction of the time sequence, the greater the possibility of ambiguity of the demand statements continuously expressed by the customer. As an example, the mean of the multi-context feature parameters of the current demand statement and the demand statements adjacent in the negative direction of the time sequence is taken as the ambiguity probability of the current demand statement.
[0084] It should be noted that the polysemy probability of the first appeal sentence defaults to 1; in other embodiments of the present invention, the weights of the multi-context feature parameters of the appeal sentence can also be adjusted, for example, the weight of the current appeal sentence is 0.6, and the weight of the adjacent appeal sentence in the negative direction of the time sequence is 0.4, to obtain the polysemy probability.
[0085] Step S303: According to the context transition probability and polysemy probability corresponding to each appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence, combined with the multi-context feature parameters of each appeal sentence, the receptive field requirement parameters of each appeal sentence are obtained; the context transition probability, polysemy probability and multi-context feature parameters are all positively correlated with the receptive field requirement parameters.
[0086] Considering that the context transition probability, polysemy probability and multi-context feature parameters of the appeal sentence all reflect the complex context characteristics of the appeal sentence, as an example, the product of the context transition probability, polysemy probability and multi-context feature parameters of the appeal sentence is normalized, and the normalized result is used as the receptive field requirement parameter of the appeal sentence.
[0087] The greater the probability of context transition, the more complex the context change of the current appeal sentence is, and the larger the receptive field is needed to capture the context change and emotion more comprehensively and accurately, and the larger the receptive field requirement parameter is; the larger the multi-context feature parameter is, the greater the possibility of multi-context from the perspective of the appeal sentence itself, and the larger the receptive field requirement parameter is; the greater the probability of polysemy, the greater the possibility of multi-context from the perspective of the local neighborhood of the appeal sentence, and the larger the receptive field requirement parameter is; the receptive field requirement parameter integrates multiple analysis angles to accurately measure the receptive field requirement characteristics of the appeal sentence, so as to prepare for the subsequent acquisition of an adaptive receptive field, train a suitable neural network model, and accurately analyze the customer appeal emotion.
[0088] Step S3: According to the receptive field requirement parameters of each appeal sentence and the sentiment weights of the keywords in adjacent appeal sentences, the receptive field of each appeal sentence is determined and the neural network is trained; the sentiment of the customer appeal is analyzed based on the trained neural network model.
[0089] In an embodiment of the present invention, after obtaining the receptive field requirement parameters of each appeal sentence, the applicable receptive field can be determined based on the actual needs of each appeal sentence, thereby training the neural network model; considering that the user's current emotional expression is usually related to adjacent appeal sentences, the receptive field is determined from the keywords of adjacent appeal sentences, but when selecting keywords, different keywords have different emotional weights, that is, the effects of solving the needs of the appeal sentences are different, so the emotional weights of the keywords in the adjacent appeal sentences must also be combined.
[0090] Preferably, in one embodiment of the present invention, considering that when customers express their demands, they are usually more closely related to the previous demand statements, and in some cases, real-time customer sentiment analysis may be required, and there are no demand statements that are later in the positive direction of the time sequence, so it is chosen to expand the receptive field from the adjacent demand statements in the negative direction of the time sequence; at the same time, in order to obtain the best receptive field, an objective function is constructed based on the receptive field requirement parameters of each demand statement and the sentiment weights of the keywords in the adjacent demand statements in the negative direction of the time sequence, and the expansion effect of the selected keywords is determined by changing the objective function, thereby determining the receptive field of each demand statement according to the objective function.
[0091] Preferably, in one embodiment of the present invention, considering that each keyword in the temporally adjacent negative direction appeal sentences has different importance to the current appeal sentence, and the receptive field requirement parameter is also normalized, the sentiment weight of each keyword in the temporally adjacent negative direction appeal sentence is normalized using the sentiment weight of all keywords in the current appeal sentence to obtain a modified sentiment weight;
[0092] Any number of keywords are randomly selected from the appeal sentences that are adjacent to the current appeal sentence in the negative direction of the time sequence, and the objective function is constructed according to the difference between the modified sentiment weights of all the selected keywords and the receptive field requirement parameters of the current appeal sentence.
[0093] As an example: The objective function calculation formula includes: Among them, x represents the serial number of the appeal statement; E x represents the objective function of the x-th appeal statement; D x represents the receptive field requirement parameter of the xth appeal statement; t represents the sequence number of the selected keyword; n represents the number of selected keywords; s x-1,t S represents the sentiment weight of the tth keyword selected in the x-1th adjacent appeal statement in the negative direction of the xth appeal statement; x,all represents the sum of the sentiment weights of all keywords in the x-th appeal statement, z represents the sequence number of the keyword in the x-th appeal statement; m represents the number of keywords in the x-th appeal statement; s x,zrepresents the sentiment weight of the zth keyword in the xth appeal statement; | | represents the absolute value.
[0094] In the calculation formula of the objective function, represents the modified sentiment weight of the selected tth keyword, through Indicates that all selected keywords can provide receptive field supply features for the current appeal sentence, through The objective function is constructed by combining the difference between receptive field demand and receptive field supply.
[0095] As another example, the objective function may also be calculated as:
[0096] Preferably, in one embodiment of the present invention, considering the supply-demand balance or the minimum difference between supply and demand, that is, when the difference between the receptive field demand and the receptive field supply is the smallest, the selected keywords can just meet the receptive field demand of the current appeal statement, so all keyword selection schemes are traversed, and converge when the objective function is minimized, and the selected keywords are used as the receptive field of the current appeal statement.
[0097] In one embodiment of the present invention, it is also taken into consideration that selecting different numbers of keywords may result in the same effect on the receptive field supply of the appeal sentence. At the same time, considering that the more keywords are selected, the more likely it is that the neural network will overfit. Therefore, the objective function also includes a penalty term. The penalty term is positively correlated with the number of selected keywords.
[0098] As an example, the penalty term may be: Wherein, Pu represents the penalty term, a represents the penalty amplitude control parameter, which is used to adjust the amplitude of the penalty term; b represents the penalty rate control parameter, which is used to adjust the rate of change of the penalty term; tanh() represents the hyperbolic tangent function; and n represents the number of selected keywords.
[0099] In one embodiment of the present invention, a=1, b=10; in other embodiments of the present invention, implementers can adjust them by themselves.
[0100] After obtaining the adaptive receptive field of each appeal statement, the neural network model can be trained. Based on the trained neural network model, the customer's true emotions can be identified in the subsequent customer communication process, and the customer service communication efficiency can be improved, customer satisfaction can be increased, service processes can be optimized, products and services can be improved, market trends can be analyzed, and operational efficiency can be improved.
[0101] It should be noted that, in one embodiment of the present invention, the selected neural network model is a convolutional neural network model, and its training process is a technical means well known to those skilled in the art and will not be described in detail here.
[0102] In summary, in order to solve the technical problem that the setting of receptive field parameters in existing neural networks is unreasonable, resulting in inaccurate sentiment analysis of customer demands, the present invention provides a method for sentiment analysis of customer demands based on convolutional neural networks. The present invention first obtains the text data of the preprocessed historical communication records; further clusters the reply sentences to obtain reply clustering clusters; clusters the demand sentences to obtain demand clustering clusters; further obtains the sentiment weight of each type of keyword based on the quantity characteristics of the reply sentences in each reply clustering cluster, combined with the distribution characteristics of each type of keywords; further obtains the multi-context feature parameters of each demand sentence based on the distribution characteristics of the reply sentences corresponding to the demand sentences in each demand clustering cluster; further obtains the receptive field requirement parameters of each demand sentence based on the changes in the sentiment weights of the keywords of the consecutive demand sentences, combined with the multi-context feature parameters; further determines the receptive field of each demand sentence based on the receptive field requirement parameters of each demand sentence, combined with the sentiment weights of the keywords in the adjacent demand sentences, and trains the neural network; finally, analyzes the sentiment of customer demands based on the trained neural network model. The present invention establishes a suitable receptive field by analyzing the contextual changes and emotional weights of customer demands, thereby avoiding the problem that the neural network model pays too much attention to local features in the learning process of customer demands and is unable to purify and learn the customer's real emotions. Blindly changing the receptive field of the neural network model learning process may cause noise problems and lead to model overfitting. The present invention can purify and learn the customer's real emotions in more complex customer communication texts.
[0103] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0104] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A customer demand sentiment analysis method based on convolutional neural network, characterized in that: The method comprises: Acquire the pre-processed text data of the historical communication records; the text data at least includes the customer's appeal statement and the customer service's reply statement; the same keywords in the appeal statement are regarded as a category of keywords; Cluster the reply sentences to obtain reply clusters; cluster the appeal sentences to obtain appeal clusters; obtain the sentiment weight of each type of keyword based on the quantity characteristics of the reply sentences in each reply cluster and the distribution characteristics of each type of keyword; obtain the multi-context feature parameters of each appeal sentence based on the distribution characteristics of the reply sentences corresponding to the appeal sentences in each appeal cluster; obtain the receptive field requirement parameters of each appeal sentence based on the changes in the sentiment weights of the keywords in the consecutive appeal sentences and the multi-context feature parameters; According to the receptive field requirement parameters of each appeal sentence, combined with the sentiment weights of the keywords in the adjacent appeal sentences, the receptive field of each appeal sentence is determined and a neural network is trained; the sentiment of the customer appeal is analyzed based on the trained neural network model; The method for obtaining the receptive field requirement parameter includes: Obtaining the context transition probability according to the difference characteristics of the sentiment weights of all keywords in each appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence; the context transition probability is positively correlated with the sentiment weights of all keywords in the current appeal sentence; According to the multi-context feature parameters of each appeal sentence and the appeal sentence adjacent to the appeal sentence in the negative direction of the time sequence, the polysemy probability of each appeal sentence is obtained; the multi-context feature parameters of the appeal sentence and the appeal sentence adjacent to the negative direction of the time sequence are all positively correlated with the polysemy probability; According to the context transition probability and the polysemy probability corresponding to each appeal sentence and the appeal sentence adjacent to it in the negative direction of the time sequence, combined with the multi-context feature parameters of each appeal sentence, the receptive field requirement parameters of each appeal sentence are obtained; the context transition probability, the polysemy probability and the multi-context feature parameters are all positively correlated with the receptive field requirement parameters.
2. According to claim 1, a method for analyzing customer demand sentiment based on convolutional neural network is characterized in that: The method for obtaining the reply cluster comprises: Each of the reply statements is converted into a vector representation, and similar features between the corresponding vectors of the reply statements are analyzed to obtain the clustering distance between the reply statements; all the reply statements are clustered based on the clustering distance to obtain the reply cluster cluster.
3. According to claim 1, a method for analyzing customer demand sentiment based on convolutional neural network is characterized in that: The method for obtaining the sentiment weight includes: Select any keyword as the target keyword; According to the number of the reply sentences in each of the reply clusters, a first emotion parameter of each of the reply clusters is obtained; the number of the reply sentences in each of the reply clusters is negatively correlated with the first emotion parameter; In all the appeal sentences corresponding to all the reply sentences in each of the reply clusters, the probability of the target keyword appearing is obtained as a second sentiment parameter corresponding to each of the reply clusters and the target keyword; The sentiment weight of the target class keyword is obtained according to the first sentiment parameter and the second sentiment parameter corresponding to the target class keyword and all the reply clusters; the first sentiment parameter and the second sentiment parameter are both positively correlated with the sentiment weight.
4. According to claim 1, a method for analyzing customer demand sentiment based on convolutional neural network is characterized in that: The method for obtaining the multi-context feature parameters includes: Obtain the reply statements corresponding to all the demand statements in the demand clustering cluster, and their distribution probability in each of the reply clustering clusters; analyze the distribution discrete features of all the reply statements corresponding to each of the demand clustering clusters based on all the distribution probabilities corresponding to each of the demand clustering clusters, and obtain the multi-context feature parameters of each of the demand statements; the distribution discrete features are positively correlated with the multi-context feature parameters.
5. According to claim 1, a method for analyzing customer demand sentiment based on convolutional neural network is characterized in that: The method for obtaining the receptive field includes: According to the receptive field requirement parameter of each appeal sentence, combined with the sentiment weight of the key words in the appeal sentence adjacent to each other in the negative direction of the time sequence, an objective function is constructed; and the receptive field of each appeal sentence is determined according to the objective function.
6. According to claim 5, a method for analyzing customer demand sentiment based on convolutional neural network is characterized in that: The method for obtaining the objective function includes: Using the sentiment weights of all the keywords in the current appeal sentence, normalizing the sentiment weight of each keyword in the appeal sentence adjacent in the negative direction of the time sequence, to obtain a modified sentiment weight; Any number of keywords are randomly selected from the appeal statements that are adjacent in the negative direction of the current appeal statement in time sequence, and an objective function is constructed based on the difference between the modified sentiment weights of all the selected keywords and the receptive field requirement parameters of the current appeal statement; the difference between the modified sentiment weights of all the selected keywords and the receptive field requirement parameters of the current appeal statement is positively correlated with the objective function.
7. The method for analyzing customer demand sentiment based on convolutional neural network according to claim 6 is characterized in that: When the objective function converges to the minimum, the selected keywords serve as the receptive field of the current appeal sentence.
8. The method for analyzing customer demand sentiment based on convolutional neural network according to claim 6, characterized in that: The objective function also includes a penalty term; the penalty term is positively correlated with the number of selected keywords.
9. The method for analyzing customer demand sentiment based on convolutional neural network according to claim 2, characterized in that: The method for obtaining the cluster distance includes: According to the cosine similarity between two vectors corresponding to any two reply statements, the cluster distance corresponding to the two reply statements is obtained; the cosine similarity is negatively correlated with the cluster distance.
Citation Information
Patent Citations
Text message emotion analysis method and system
CN107967258A
Natural language processing-based multi-language analysis method and device
CN108197109A