Text sentiment analysis method and device, equipment and storage medium
Through word vector extraction and sentiment analysis model, it solves the problem of identifying user concerns in customer service communication information, achieves efficient and accurate information mining, and improves customer satisfaction.
Patent Information
- Application Number
- CN202311478418.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2024-10-22
AI Technical Summary
Existing technologies rely on manual labeling and classification when handling customer service complaints and inquiries, resulting in missing information and insufficient accuracy, failing to effectively identify user needs and concerns, and consuming a lot of manpower and material resources.
The word vector extraction model and target sentiment analysis model are used to extract word vectors of customer service communication texts through the embedding layer and convolutional neural network (CNN), and the bidirectional layer and grouping enhancement mechanism layer are used for emotion recognition, and the model is trained to mine user concerns. .
It achieves accurate emotion recognition of customer service communication information and efficient mining of user concerns, reduces labor costs, improves the accuracy and efficiency of information, and provides a basis for improving customer satisfaction.
Smart Images

Figure CN118820409A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a text sentiment analysis method, device, equipment and storage medium. Background Art
[0002] In recent years, the number of customers of telecommunications operators has steadily increased, the scope of business has expanded, and the number and complexity of complaints and consultations they face has become increasingly numerous and complex. Communication between users and customer service personnel is an important factor in users understanding product information, establishing customer relationships, and enhancing users' purchasing intentions. Quickly and accurately handling complaints and consultation issues is an important aspect of improving customer satisfaction and operator benefits, and analyzing and obtaining user demands and concerns is the prerequisite for solving problems. Currently, customer service complaints and consultations from users mostly rely on customer service to manually mark the categories to which the information belongs, the business involved, and other content, and to roughly classify these contents or perform simple data statistics. This method consumes a lot of manpower, material resources and time costs. In addition, due to excessive manual participation in the process of data transmission and statistical analysis, information may be missed, and users' needs and concerns cannot be effectively identified, and the accuracy of the information cannot be guaranteed.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a text sentiment analysis method, device, equipment and storage medium, aiming to solve the technical problem of how to accurately and efficiently mine user concerns from customer service communication information in the prior art.
[0005] To achieve the above object, the present invention provides a text sentiment analysis method, which comprises the following steps: Extract word vectors from the customer service communication text according to a word vector extraction model to determine the word vectors of the customer service communication text, wherein the word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer is composed of two sub-layers: a language representation model and a normalized Google distance algorithm; Performing sentiment recognition according to the target sentiment analysis model and the word vector to determine the sentiment label of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; Model training is performed based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and user focus points of the customer service communication text are obtained based on the training results.
[0006] Optionally, extracting word vectors from the customer service communication text according to the word vector extraction model to determine the word vectors of the customer service communication text includes: Inputting the customer service communication text into an embedding layer in a word vector extraction model to obtain a merged feature set of the customer service communication text; Allocating scores for the merged feature set according to a preset score allocation method to determine a correlation score for the merged feature set; Determining a target hidden state of the customer service communication text according to the word vector extraction model and the customer service communication text; A word vector of the customer service communication text is determined according to a correlation score between the target hidden state and the merged feature set.
[0007] Optionally, performing sentiment recognition according to the target sentiment analysis model and the word vector to determine the sentiment label of the customer service communication text includes: Perform feature extraction based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the context feature vector of the customer service communication text; Perform information enhancement according to the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine an enhanced feature vector; Feature processing is performed according to the target sentiment analysis model and the enhanced feature vector to obtain a sentiment label of the customer service communication text.
[0008] Optionally, performing feature extraction based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the context feature vector of the customer service communication text includes: Determine a first context feature and a second context feature according to the bidirectional long short-term memory network and the word vector in the target sentiment analysis model; Determine a third context feature and a fourth context feature according to the bidirectional gated recurrent unit in the target sentiment analysis model and the word vector; A context feature vector of the customer service communication text is obtained according to the first context feature, the second context feature, the third context feature, and the fourth context feature.
[0009] Optionally, performing information enhancement according to the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine the enhanced feature vector includes: Determine a global feature vector of the customer service communication text according to the word vector, the dimension corresponding to the word vector, the context feature vector, and preset grouping information corresponding to the word vector; Determining a feature significance coefficient of the customer service communication text according to the global feature vector and a preset coefficient construction method; Perform coefficient conversion according to the feature significance coefficient to determine the importance coefficient corresponding to the context feature vector; Information enhancement is performed according to the importance coefficient and the context feature vector to determine an enhanced feature vector.
[0010] Optionally, performing model training according to the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and obtaining the user focus of the customer service communication text according to the training results, includes: Determine a focus point vector of the customer service communication text and a focus point probability distribution of the customer service communication text according to the word vector of the customer service communication text and the sentiment label of the customer service communication text; Performing hyperparameter calculation based on the focus point vector of the customer service communication text and the focus point probability distribution of the customer service communication text to determine the target hyperparameter; A user focus of the customer service communication text is determined according to the target hyperparameter.
[0011] Optionally, before extracting word vectors from the customer service communication text according to the word vector extraction model and determining the word vectors of the customer service communication text, the method further includes: Upon receiving the customer service communication information, determining the information type of the customer service communication information; When the information type is a voice type, performing voice conversion on the customer service communication information to determine an initial communication text; The initial communication text is subjected to text elimination to obtain a customer service communication text.
[0012] In addition, to achieve the above object, the present invention also proposes a text sentiment analysis device, the text sentiment analysis device comprising: An extraction module, used to extract word vectors from customer service communication texts according to a word vector extraction model to determine word vectors of the customer service communication texts, wherein the word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer is composed of two sub-layers: a language representation model and a normalized Google distance algorithm; A recognition module, used to perform sentiment recognition based on a target sentiment analysis model and the word vector to determine the sentiment label of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; The training module is used to perform model training based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and obtain the user focus of the customer service communication text based on the training results.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also proposes a text sentiment analysis device, which includes: a memory, a processor, and a text sentiment analysis program stored in the memory and executable on the processor, and the text sentiment analysis program is configured to implement the steps of the text sentiment analysis method described above.
[0014] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a text sentiment analysis program is stored, and when the text sentiment analysis program is executed by a processor, the steps of the text sentiment analysis method described above are implemented.
[0015] The present invention extracts word vectors from a customer service communication text according to a word vector extraction model to determine the word vectors of the customer service communication text, wherein the word vector extraction model consists of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer consists of two sublayers, namely a language representation model and a normalized Google distance algorithm; emotion recognition is performed according to a target emotion analysis model and the word vectors to determine the emotion tags of the customer service communication text, wherein the target emotion analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; model training is performed according to the word vectors of the customer service communication text and the emotion tags of the customer service communication text, and user focus points of the customer service communication text are obtained according to the training results. Through the above method, word vectors are extracted for customer service communication text according to the word vector extraction model including an embedding layer and multiple CNN layers, so that the word vectors in the customer service communication text can be accurately extracted. At the same time, sentiment recognition is performed through the target sentiment analysis model and word vectors including a bidirectional layer and a grouping enhancement mechanism layer, thereby improving the accuracy of sentiment recognition of the customer service communication text. Focus mining is performed based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, which can efficiently and accurately mine the user's concerns, thereby providing a basis for subsequent product analysis and business improvement through user concerns, thereby effectively improving customer satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural diagram of a text sentiment analysis device in a hardware operating environment involved in an embodiment of the present invention; Figure 2 This is a flow chart of the first embodiment of the text sentiment analysis method of the present invention; Figure 3 A schematic diagram of the structure of a target sentiment analysis model of an embodiment of a text sentiment analysis method of the present invention; Figure 4 A schematic diagram of the structure of a Bayesian probability model of an embodiment of a text sentiment analysis method of the present invention; Figure 5 A Bayesian network diagram of an embodiment of a text sentiment analysis method of the present invention; Figure 6 This is a flow chart of a second embodiment of the text sentiment analysis method of the present invention; Figure 7 A schematic diagram of the structure of a single embedding layer of an embodiment of a text sentiment analysis method of the present invention; Figure 8 A schematic diagram of the structure of an embedded CNN model of an embodiment of a text sentiment analysis method of the present invention; Fig. 9 This is a flow chart of a third embodiment of the text sentiment analysis method of the present invention; Fig.10 This is a structural block diagram of the first embodiment of the text sentiment analysis device of the present invention.
[0017] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0019] Reference Figure 1 , Figure 1 A schematic diagram of the structure of a text sentiment analysis device in the hardware operating environment involved in an embodiment of the present invention.
[0020] like Figure 1 As shown, the text sentiment analysis device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0021] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the text sentiment analysis device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0022] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a text sentiment analysis program.
[0023] exist Figure 1 In the text sentiment analysis device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the text sentiment analysis device of the present invention can be set in the text sentiment analysis device, and the text sentiment analysis device calls the text sentiment analysis program stored in the memory 1005 through the processor 1001, and executes the text sentiment analysis method provided by the embodiment of the present invention.
[0024] The present invention provides a text sentiment analysis method, referring to Figure 2 , Figure 2 The figure is a flow chart of a first embodiment of a text sentiment analysis method of the present invention.
[0025] In this embodiment, the text sentiment analysis method includes the following steps: Step S10: Extract word vectors for the customer service communication text according to a word vector extraction model to determine the word vectors of the customer service communication text. The word vector extraction model consists of an embedding layer and multiple convolutional neural network (CNN) layers. The embedding layer consists of two sub-layers: a language representation model and a normalized Google distance algorithm.
[0026] It should be noted that the executor of this embodiment is a text sentiment analysis device, wherein the text sentiment analysis device has functions such as data processing, data communication and program running. The text sentiment analysis device can be an integrated controller, a control computer and other devices, and of course it can also be other devices with similar functions, and this embodiment does not limit this.
[0027] It can be understood that the customer service communication text refers to the text content after preprocessing the customer service communication information. The word vector extraction model consists of a single embedding layer and four CNN layers. The word vector extraction model is used to extract word vectors from the customer service communication text to obtain the word vector of the customer service communication text.
[0028] In a specific implementation, in order to ensure the accuracy of subsequent word vector extraction, further, the word vector extraction of the customer service communication text according to the word vector extraction model is performed, and before the word vector of the customer service communication text is determined, it also includes: when receiving customer service communication information, determining the information type of the customer service communication information; when the information type is a voice type, performing voice conversion on the customer service communication information to determine the initial communication text; and performing text elimination on the initial communication text to obtain the customer service communication text.
[0029] It should be noted that when customer service communication information is received, the information type of the customer service communication information is determined. The information type includes voice type and text type. When the information type is voice type, the customer service communication information must first be voice recognized, and the customer service communication information is converted according to the recognition result to obtain the text content corresponding to the customer service communication information. The text content corresponding to the customer service communication information is the initial communication text.
[0030] It is understandable that after obtaining the initial communication text, the initial communication text is subjected to data cleaning, including dialogue segmentation and word segmentation processing, which is mainly used to eliminate meaningless text / words or repeated text / words in the initial communication text to avoid this part of the content from affecting the subsequent user focus identification results. The initial communication text after data cleaning is the customer service communication text.
[0031] In a specific implementation, if the received customer service communication information is of text type, data cleaning is directly performed on the customer service communication information, and the customer service communication information after data cleaning is the customer service communication text.
[0032] Step S20: performing sentiment recognition according to the target sentiment analysis model and the word vector to determine the sentiment label of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer.
[0033] It should be noted that the target sentiment analysis model is a model used to identify the user sentiment corresponding to the customer service communication text, and can output the sentiment label of the customer service communication text. The target sentiment analysis model consists of an embedding layer, a bidirectional layer, a grouping enhancement mechanism layer, a convolutional layer, a pooling layer, and a fully connected layer. The bidirectional layer includes two bidirectional architectures: bidirectional GRU and bidirectional LSTM. The specific structure of the target sentiment analysis model is as follows: Figure 3 shown.
[0034] It can be understood that the embedding layer in the target sentiment analysis model can receive the word vector representation corresponding to the customer service communication text; the bidirectional layer is used to extract high-quality features from the customer service communication information in order to consider the previous and next contexts, and better solve the sequential modeling problem by integrating the forward layer and the hidden layer; then, the group enhancement mechanism layer is used to group and enhance the global features extracted by the GRU (Gated Recurrent Unit) and LSTM (Long Short-Term Memory) layers, and enhance the important features by assigning higher importance coefficients while reducing the uninformative features. In the group enhancement mechanism, the GRU and LSTM features are divided into multiple groups to enhance the important features in each group and weaken the less important features; the convolution layer is used to extract high-quality local features, and the pooling layer (maximum pooling scheme) is used to reduce the dimensionality of the feature space; finally, the fully connected layer is used to identify the emotional orientation of users and customer service in the customer service communication information based on the cascade enhanced feature set.
[0035] In a specific implementation, the grouping enhancement mechanism is a hybrid deep neural network module that can change the importance of each sub-feature by creating an attention factor for each spatial position in the semantic group of each customer service communication text, allowing each group to independently enhance its learning expression and suppress possible noise. This embodiment constructs a spatial enhancement mechanism within each feature group by scaling the feature vector at all positions using an attention mask. This attention mask is intended to block any background noise while highlighting the appropriate semantic feature area. Unlike other prominent attention mechanisms, the attention mask of this embodiment can use the similarity between global statistical features and local statistical features of each place as the source of attention mask generation. The grouping enhancement mechanism is intended to enhance the weight values associated with informative features while weakening the weight values associated with non-informative features. Due to the availability of uninformative features, it is usually difficult to obtain a properly distributed feature set to build a learning model on a deep neural architecture. The grouping enhancement mechanism is intended to exploit the general information of the entire semantics in the key area, and the model is intended to approximate the semantic vector represented by the group.
[0036] Step S30: Perform model training based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and obtain user focus points of the customer service communication text based on the training results.
[0037] It should be noted that after determining the word vectors and sentiment labels of the customer service communication text, a dialogue corpus is constructed and put into a three-layer Bayesian probability model for training, thereby obtaining the user focus in the customer service communication text.
[0038] It can be understood that in order to accurately mine the user focus points in the customer service communication text, further, the model training is performed based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and the user focus points of the customer service communication text are obtained based on the training results, including: determining the focus point vector of the customer service communication text and the focus point probability distribution of the customer service communication text based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text; performing hyperparameter calculation based on the focus point vector of the customer service communication text and the focus point probability distribution of the customer service communication text to determine the target hyperparameter; and determining the user focus points of the customer service communication text based on the target hyperparameter.
[0039] In the specific implementation, the dialogue corpus is constructed based on the word vectors and sentiment labels of the customer service communication texts: and the corresponding emotion labels, where S represents the encoded conversation text set, represents the i-th dialogue, It's a dialogue The processed dialogue data is put into the model for training. The model is a three-layer Bayesian probability model embedded in the dialogue text sentiment analysis, covering the three-layer structure of words, focus points and dialogue context, such as Figure 4 shown.
[0040] It should be noted that the Bayesian probability model is based on the assumption that the dialogues in the dialogue data set contain customer emotional information, each dialogue text is composed of multiple focus points with a certain probability combination, and each focus point is composed of multiple target words. Figure 5 As shown. The hollow circle indicates that the variable is an implicit variable, the solid state indicates an observable variable, the line indicates conditional probability dependence, the box indicates the number of repetitions, M indicates the total number of customer service communication texts, N indicates the number of word vectors in the target vocabulary corresponding to the customer service communication texts, θ and φ indicate the Dirichlet prior distributions subject to the hyperparameters α and β, θ indicates the probability distribution of the focus points of the customer service communication texts, φ indicates the probability distribution of the target words of the focus points, z and w indicate the focus point vectors and target word vectors of the corresponding customer service communication texts, and h indicates the sentiment label of the corresponding customer service communication information.
[0041] It is understandable that the two probability distribution models of the focus point probability distribution θ and the target word probability distribution φ of the customer service communication text need to be derived and solved. Generally, the Gibbs sampling method is used to approximate the solution. The derivation process is as follows: (1) Calculate the probability distribution of customer service communication information emotion-focus point-target word: ; (2) According to the Bayesian formula and the Dirichlet prior distribution, calculate the Dirichlet distribution expectation: , ,in, represents the probability of focus point k in text m, represents the probability of target word t in focus point k, represents the number of target words of focus point k in text m, represents the number of occurrences of the target word t at the focus point k, represents the number of target words of all focus points in the text m, represents the number of times all target words appear at the focus point k; (3) Gibbs sampling is used to obtain the following probability distribution:
[0042] ,in, represents the number of target words in text m that are not assigned to focus point k, represents the number of times the target word t is not assigned to the focus point k. represents the number of unassigned target words for each focus point in the text m, Indicates the number of times each target word in the focus word k is not assigned.
[0043] In the specific implementation, for the dialogue corpus, the model's focus mining process is realized through the probability distribution of customer service communication text focus points θ and the focus point vector z corresponding to the customer service communication text. In the model, all customer service communication texts and the target words of the text are observable, and the focus points of the text are implicit variables. Therefore, through known data and text generation rules, the model can realize parameter estimation, and calculate the maximum hyperparameters α and β through the probability distribution of customer service communication text focus points θ and the focus point vector z corresponding to the customer service communication text, and finally obtain the user focus points of implicit emotional information. Among them, the maximum hyperparameters α and β are the target hyperparameters.
[0044] It should be noted that, through the method of this embodiment, the device automatically records all communication information, which will not cause omissions and misunderstandings of information, and reduce labor costs. In addition, for the complaints and consultation content in the customer service communication text corresponding to the customer service communication information, the user's concerns, products, and reasons for user dissatisfaction can be mined, which can provide a basis for the company to promote business optimization, solve problems, and improve customer satisfaction, and promote the initiative and accuracy of services.
[0045] This embodiment determines the word vector of the customer service communication text by extracting word vectors from the customer service communication text according to a word vector extraction model, wherein the word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer is composed of two sub-layers, namely a language representation model and a normalized Google distance algorithm; emotion recognition is performed according to a target sentiment analysis model and the word vector to determine the emotion tag of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; model training is performed according to the word vector of the customer service communication text and the emotion tag of the customer service communication text, and user focus points of the customer service communication text are obtained according to the training results. Through the above method, word vectors are extracted for customer service communication text according to the word vector extraction model including an embedding layer and multiple CNN layers, so that the word vectors in the customer service communication text can be accurately extracted. At the same time, sentiment recognition is performed through the target sentiment analysis model and word vectors including a bidirectional layer and a grouping enhancement mechanism layer, thereby improving the accuracy of sentiment recognition of the customer service communication text. Focus mining is performed based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, which can efficiently and accurately mine the user's concerns, thereby providing a basis for subsequent product analysis and business improvement through user concerns, thereby effectively improving customer satisfaction.
[0046] refer to Figure 6 , Figure 6 This is a flow chart of a second embodiment of a text sentiment analysis method of the present invention.
[0047] Based on the above first embodiment, the text sentiment analysis method of this embodiment includes, in step S10: Step S11: input the customer service communication text into the embedding layer in the word vector extraction model to obtain a merged feature set of the customer service communication text.
[0048] It should be noted that in the prior art, the word vectors corresponding to the customer service communication text are usually extracted through models such as word2vec, fasttext, or Bidirectional Encoder Representation of Transformers (BERT). However, when using the word2vec and fasttext models to extract word vectors, since these two models are trained on predefined models, the information of words other than the words used in pre-training may not be covered when extracting word vectors based on such models, resulting in the extracted word vectors failing to accurately and comprehensively reflect the customer service communication information. Secondly, when using the Bidirectional Encoder Representation of Transformers (BERT) model, some uncommon words in the customer service communication information are difficult to understand, which may result in inaccurate extracted word vectors. In order to solve the above text, the word vector extraction model used in this embodiment consists of a single embedding layer and four CNN layers. The single embedding layer consists of two sub-layers, BERT and NGD. NGD is the normalized Google distance algorithm. The specific structure of a single embedding layer is as follows: Figure 7 shown.
[0049] It can be understood that the specific structure of the embedded CNN model used for feature generation in this embodiment is as follows: Figure 8 As shown, the embedded CNN model for feature generation can label each input position with Y=B, I, O. Among them, B represents a phrase in the customer service communication text; I represents the beginning and end of the customer service communication text; O represents the abbreviation of the word representing the opinion in the customer service communication text. Secondly, the embedded CNN model for feature generation can also share a fully connected layer to process all feature dimensions of the given customer service communication information, and then divide it into opinion words and non-opinion words, as well as a normalization layer. At the same time, the embedded CNN model for feature generation includes multiple filters with a kernel size of k=2c+1. Each filter participates in the formation of words in the customer service communication text that contain specific 2c nearby words. Finally, the embedded CNN model for feature generation uses a fully connected layer and a normalization layer to obtain the final vector set.
[0050] In the specific implementation, the customer service communication text is input into a single embedding layer in this vector extraction model for processing to obtain the BERT-based embedding W of the customer service communication information. bert and W ngd , and obtain the merged feature set {af1, af2, af3…afn}.
[0051] Step S12: allocating scores for the merged feature set according to a preset score allocation method to determine a correlation score of the merged feature set.
[0052] It should be noted that after processing the combined feature set {af1, af2, af3…afn} in a single embedding layer, the EMD can be obtained CNN ={ngd af1 |bert af1 ,ngd af2 |bert af2 , …, ngd afn |bert afn}, based on EMD CNN Through NDG, a correlation score is assigned to the combined feature set of each customer service communication text according to a preset score allocation method. The preset score allocation method is shown in the formula: .
[0053] Step S13: determining a target hidden state of the customer service communication text according to the word vector extraction model and the customer service communication text.
[0054] It should be noted that on the BERT side, the customer service communication text is input into L S The continuous Transformers encoder blocks obtain the final hidden state of the customer service communication text. The final hidden state of the customer service communication text is the target hidden state of the customer service communication text.
[0055] Step S14: determining a word vector of the customer service communication text according to the target hidden state and the correlation score of the merged feature set.
[0056] It should be noted that according to W bert and W ngd , the inner product between the target hidden state of the customer service communication text and the relevance score of the merged feature set of the customer service communication text determines the word vector of the customer service communication text.
[0057] This embodiment obtains a merged feature set of the customer service communication text by inputting the customer service communication text into the embedding layer in the word vector extraction model; assigns scores to the merged feature set according to a preset score assignment method to determine the relevance score of the merged feature set; determines the target hidden state of the customer service communication text according to the word vector extraction model and the customer service communication text; and determines the word vector of the customer service communication text according to the relevance score of the target hidden state and the merged feature set. In the above manner, the merged feature set and target hidden state of the customer service communication text are determined according to the word vector extraction model including a single embedding layer and multiple CNN layers, and finally the word vector of the customer service communication text is determined based on the relevance score of the target hidden state and the merged feature set, thereby ensuring the accuracy of the word vector extraction.
[0058] refer to Fig. 9 , Fig. 9This is a flow chart of a third embodiment of a text sentiment analysis method of the present invention.
[0059] Based on the above embodiment, the text sentiment analysis method of this embodiment includes, in step S20: Step S21: performing feature extraction based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the context feature vector of the customer service communication text.
[0060] It should be noted that, based on the word vector of the customer service communication text, the bidirectional LSTM and bidirectional GRU in the bidirectional layer of the target sentiment analysis model are used to obtain the contextual features of the customer service communication text. To ensure the accuracy of feature acquisition, further, feature extraction is performed based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the contextual feature vector of the customer service communication text, including: determining the first contextual feature and the second contextual feature according to the bidirectional long short-term memory network and the word vector in the target sentiment analysis model; determining the third contextual feature and the fourth contextual feature according to the bidirectional gated recurrent unit and the word vector in the target sentiment analysis model; and obtaining the contextual feature vector of the customer service communication text based on the first contextual feature, the second contextual feature, the third contextual feature and the fourth contextual feature.
[0061] It can be understood that based on the word vector, the above-mentioned context features of LSTM and the subsequent context features of LSTM are obtained according to the bidirectional long short-term memory network in the bidirectional layer, and the above-mentioned context features of LSTM are the first context features, and the subsequent context features of LSTM are the second context features; the previous GRU context features and the subsequent context features of GRU are obtained according to the bidirectional gated recurrent unit in the bidirectional layer, and the previous GRU context features are the third context features, and the subsequent GRU context features are the fourth context features. Finally, the context feature vector of the customer service communication text is obtained according to the first context features, the second context features, the third context features and the fourth context features.
[0062] Step S22: performing information enhancement according to the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine an enhanced feature vector.
[0063] It should be noted that the feature vector of the enhanced customer service communication text is obtained by using two grouping enhancement mechanism layers in the target sentiment analysis model based on the context feature vector. The feature vector of the enhanced customer service communication text is the enhanced feature vector.
[0064] It can be understood that in order to ensure that the enhanced feature vector is accurately obtained by using the grouping enhancement mechanism layer and the context feature vector, further, the information is enhanced according to the grouping enhancement mechanism layer and the context feature vector in the target sentiment analysis model to determine the enhanced feature vector, including: determining the global feature vector of the customer service communication text according to the word vector, the dimension corresponding to the word vector, the context feature vector and the preset grouping information corresponding to the word vector; determining the feature significance coefficient of the customer service communication text according to the global feature vector and the preset coefficient construction method; performing coefficient conversion according to the feature significance coefficient to determine the importance coefficient corresponding to the context feature vector; performing information enhancement according to the importance coefficient and the context feature vector to determine the enhanced feature vector.
[0065] In the specific implementation, based on the word vector X=[x1, x2, x3, …, xn] of the customer service communication text, the global feature vector of the customer service communication text is obtained according to the following formula through the global statistical features of the spatial average function: ,in is the global feature vector, n represents the dimension corresponding to the word vector, p represents the preset grouping information corresponding to the word vector, i represents the i-th word embedding in the customer service communication text, A contextual feature vector representing the customer service conversation text.
[0066] It should be noted that the corresponding significant coefficient is constructed for each feature in the customer service communication text according to the global feature vector and the preset coefficient construction method. , the preset coefficients are constructed as follows: , the corresponding significance coefficient of each feature is the feature significance coefficient of the customer service communication text.
[0067] It is understandable that in order to avoid the deviation coefficient values between different customer service communication texts, the feature significance coefficient can be normalized in space to obtain , ,in, ; , Indicates the preset constant parameters. The importance coefficient of the context feature vector of the customer service communication text can be calculated ,in, It can be set according to actual needs.
[0068] In a specific implementation, the context feature vector is scaled by the importance coefficient to obtain the context feature vector of the enhanced customer service communication text. The context feature vector of the enhanced customer service communication text is the enhanced feature vector. ,in, The context feature vector representing the enhanced customer service conversation text, A contextual feature vector representing the customer service conversation text.
[0069] Step S23: performing feature processing according to the target sentiment analysis model and the enhanced feature vector to obtain a sentiment label of the customer service communication text.
[0070] It should be noted that the enhanced feature vector is processed by the convolution layer in the target sentiment analysis model, and the maximum pooling scheme is used to filter the elements with the largest amount of information from the local feature matrix corresponding to the customer service communication text; then, the output of the pooling layer is connected, and the concatenated feature vector is sent to the fully connected layer and processed by two activation function layers; finally, the comprehensive context scheme is fed into the softmax classifier to obtain the sentiment label of the customer service communication text.
[0071] This embodiment determines the context feature vector of the customer service communication text by extracting features based on the bidirectional layer of the target sentiment analysis model and the word vector; performs information enhancement based on the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine the enhanced feature vector; performs feature processing based on the target sentiment analysis model and the enhanced feature vector to obtain the sentiment label of the customer service communication text. In the above manner, the word vector of the customer service communication text is analyzed by the target sentiment analysis model with a bidirectional layer and a grouping enhancement mechanism layer, which can ensure the accuracy and efficiency of obtaining sentiment labels.
[0072] In addition, an embodiment of the present invention further proposes a storage medium, on which a text sentiment analysis program is stored. When the text sentiment analysis program is executed by a processor, the steps of the text sentiment analysis method described above are implemented.
[0073] Reference Fig.10 , Fig.10 This is a structural block diagram of the first embodiment of the text sentiment analysis device of the present invention.
[0074] like Fig.10 As shown, the text sentiment analysis device proposed in the embodiment of the present invention includes: The extraction module 10 is used to extract word vectors from the customer service communication text according to the word vector extraction model to determine the word vectors of the customer service communication text. The word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers. The embedding layer is composed of two sub-layers: a language representation model and a normalized Google distance algorithm.
[0075] The recognition module 20 is used to perform emotion recognition based on the target emotion analysis model and the word vector to determine the emotion label of the customer service communication text. The target emotion analysis model includes a bidirectional layer and a grouping enhancement mechanism layer.
[0076] The training module 30 is used to perform model training based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and obtain the user focus points of the customer service communication text based on the training results.
[0077] This embodiment determines the word vector of the customer service communication text by extracting word vectors from the customer service communication text according to a word vector extraction model, wherein the word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer is composed of two sub-layers, namely a language representation model and a normalized Google distance algorithm; emotion recognition is performed according to a target sentiment analysis model and the word vector to determine the emotion tag of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; model training is performed according to the word vector of the customer service communication text and the emotion tag of the customer service communication text, and user focus points of the customer service communication text are obtained according to the training results. Through the above method, word vectors are extracted for customer service communication text according to the word vector extraction model including an embedding layer and multiple CNN layers, so that the word vectors in the customer service communication text can be accurately extracted. At the same time, sentiment recognition is performed through the target sentiment analysis model and word vectors including a bidirectional layer and a grouping enhancement mechanism layer, thereby improving the accuracy of sentiment recognition of the customer service communication text. Focus mining is performed based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, which can efficiently and accurately mine the user's concerns, thereby providing a basis for subsequent product analysis and business improvement through user concerns, thereby effectively improving customer satisfaction.
[0078] In one embodiment, the extraction module 10 is further used to input the customer service communication text into an embedding layer in a word vector extraction model to obtain a merged feature set of the customer service communication text; Allocating scores for the merged feature set according to a preset score allocation method to determine a correlation score for the merged feature set; Determining a target hidden state of the customer service communication text according to the word vector extraction model and the customer service communication text; A word vector of the customer service communication text is determined according to a correlation score between the target hidden state and the merged feature set.
[0079] In one embodiment, the recognition module 20 is further used to perform feature extraction based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the context feature vector of the customer service communication text; Perform information enhancement according to the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine an enhanced feature vector; Feature processing is performed according to the target sentiment analysis model and the enhanced feature vector to obtain a sentiment label of the customer service communication text.
[0080] In one embodiment, the recognition module 20 is further used to determine the first context feature and the second context feature according to the bidirectional long short-term memory network in the target sentiment analysis model and the word vector; Determine a third context feature and a fourth context feature according to the bidirectional gated recurrent unit in the target sentiment analysis model and the word vector; A context feature vector of the customer service communication text is obtained according to the first context feature, the second context feature, the third context feature, and the fourth context feature.
[0081] In one embodiment, the recognition module 20 is further used to determine the global feature vector of the customer service communication text according to the word vector, the dimension corresponding to the word vector, the context feature vector and the preset grouping information corresponding to the word vector; Determining a feature significance coefficient of the customer service communication text according to the global feature vector and a preset coefficient construction method; Perform coefficient conversion according to the feature significance coefficient to determine the importance coefficient corresponding to the context feature vector; Information enhancement is performed according to the importance coefficient and the context feature vector to determine an enhanced feature vector.
[0082] In one embodiment, the training module 30 is further used to determine the focus vector of the customer service communication text and the focus probability distribution of the customer service communication text according to the word vector of the customer service communication text and the sentiment label of the customer service communication text; Performing hyperparameter calculation based on the focus point vector of the customer service communication text and the focus point probability distribution of the customer service communication text to determine the target hyperparameter; A user focus of the customer service communication text is determined according to the target hyperparameter.
[0083] In one embodiment, the extraction module 10 is further used to determine the information type of the customer service communication information when receiving the customer service communication information; When the information type is a voice type, performing voice conversion on the customer service communication information to determine an initial communication text; The initial communication text is subjected to text elimination to obtain a customer service communication text.
[0084] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0085] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0086] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0087] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0088] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0089] 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 invention is essentially 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 a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0090] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A text sentiment analysis method, It is characterized in that The text sentiment analysis method comprises: Extract word vectors from the customer service communication text according to a word vector extraction model to determine the word vectors of the customer service communication text, wherein the word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer is composed of two sub-layers: a language representation model and a normalized Google distance algorithm; Performing sentiment recognition according to the target sentiment analysis model and the word vector to determine the sentiment label of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; Model training is performed based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and user focus points of the customer service communication text are obtained based on the training results.
2. The text sentiment analysis method according to claim 1, It is characterized in that The extracting word vectors of the customer service communication text according to the word vector extraction model to determine the word vectors of the customer service communication text includes: Inputting the customer service communication text into an embedding layer in a word vector extraction model to obtain a merged feature set of the customer service communication text; Allocating scores for the merged feature set according to a preset score allocation method to determine a correlation score for the merged feature set; Determining a target hidden state of the customer service communication text according to the word vector extraction model and the customer service communication text; A word vector of the customer service communication text is determined according to a correlation score between the target hidden state and the merged feature set.
3. The text sentiment analysis method according to claim 1, It is characterized in that The performing emotion recognition according to the target emotion analysis model and the word vector to determine the emotion label of the customer service communication text includes: Perform feature extraction based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the context feature vector of the customer service communication text; Perform information enhancement according to the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine an enhanced feature vector; Feature processing is performed according to the target sentiment analysis model and the enhanced feature vector to obtain a sentiment label of the customer service communication text.
4. The text sentiment analysis method as claimed in claim 3, It is characterized in that The step of performing feature extraction based on the bidirectional layer of the target sentiment analysis model and the word vector to determine the context feature vector of the customer service communication text includes: Determine a first context feature and a second context feature according to the bidirectional long short-term memory network and the word vector in the target sentiment analysis model; Determine a third context feature and a fourth context feature according to the bidirectional gated recurrent unit in the target sentiment analysis model and the word vector; A context feature vector of the customer service communication text is obtained according to the first context feature, the second context feature, the third context feature, and the fourth context feature.
5. The text sentiment analysis method as claimed in claim 3, It is characterized in that The step of performing information enhancement according to the grouping enhancement mechanism layer in the target sentiment analysis model and the context feature vector to determine the enhanced feature vector includes: Determine a global feature vector of the customer service communication text according to the word vector, the dimension corresponding to the word vector, the context feature vector, and preset grouping information corresponding to the word vector; Determining a feature significance coefficient of the customer service communication text according to the global feature vector and a preset coefficient construction method; Perform coefficient conversion according to the feature significance coefficient to determine the importance coefficient corresponding to the context feature vector; Information enhancement is performed according to the importance coefficient and the context feature vector to determine an enhanced feature vector.
6. The text sentiment analysis method according to claim 1, It is characterized in that The performing model training according to the word vector of the customer service communication text and the sentiment label of the customer service communication text, and obtaining the user focus of the customer service communication text according to the training result, includes: Determine a focus point vector of the customer service communication text and a focus point probability distribution of the customer service communication text according to the word vector of the customer service communication text and the sentiment label of the customer service communication text; Performing hyperparameter calculation based on the focus point vector of the customer service communication text and the focus point probability distribution of the customer service communication text to determine the target hyperparameter; A user focus of the customer service communication text is determined according to the target hyperparameter.
7. The text sentiment analysis method according to any one of claims 1 to 6, It is characterized in that Before extracting word vectors from the customer service communication text according to the word vector extraction model and determining the word vectors of the customer service communication text, the method further includes: Upon receiving the customer service communication information, determining the information type of the customer service communication information; When the information type is a voice type, performing voice conversion on the customer service communication information to determine an initial communication text; The initial communication text is subjected to text elimination to obtain a customer service communication text.
8. A text sentiment analysis device, It is characterized in that The text sentiment analysis device comprises: An extraction module, used to extract word vectors from customer service communication texts according to a word vector extraction model to determine word vectors of customer service communication texts, wherein the word vector extraction model is composed of an embedding layer and multiple convolutional neural network (CNN) layers, and the embedding layer is composed of two sub-layers: a language representation model and a normalized Google distance algorithm; A recognition module, used to perform sentiment recognition based on a target sentiment analysis model and the word vector to determine the sentiment label of the customer service communication text, wherein the target sentiment analysis model includes a bidirectional layer and a grouping enhancement mechanism layer; The training module is used to perform model training based on the word vectors of the customer service communication text and the sentiment tags of the customer service communication text, and obtain the user focus of the customer service communication text based on the training results.
9. A text sentiment analysis device, It is characterized in that The device comprises: a memory, a processor, and a text sentiment analysis program stored in the memory and executable on the processor, wherein the text sentiment analysis program is configured to implement the text sentiment analysis method according to any one of claims 1 to 7.
10. A storage medium, It is characterized in that The storage medium stores a text sentiment analysis program, and when the text sentiment analysis program is executed by the processor, the text sentiment analysis method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
A data prediction method and system for automobile installment loan overdue rate
CN119784494A
