User comment sentiment analysis method and device, equipment, storage medium and product

Through the adaptive phase adjustment neural network and the random forest classifier of Dirichlet allocation, combined with user comments and social relationship network, the problem of failing to fully consider the user's social relationship in the existing technology is solved, and a more accurate and comprehensive emotion is achieved analyze.

CN118733778APending Publication Date: 2024-10-01CHINA MOBILE GROUP DESIGN INST +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411011541.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The existing technology fails to fully consider the impact of user social relationships on sentiment analysis of user comments, resulting in insufficient and limited analysis of subtle sentiment differences.

Method used

An adaptive phase adjustment neural network and a random forest classifier based on Dirichlet allocation are used, combined with user comments, attributes and social relationship networks, and a comprehensive feature vector is generated for emotion classification by dynamically adjusting the neural network parameters and feature selection.

Benefits of technology

It improves the accuracy and robustness of sentiment classification, can more effectively capture subtle sentiment differences in user comments, and considers the user's location and relationship in the social network to provide a more comprehensive and precise sentiment analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733778A_ABST
    Figure CN118733778A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of user comment analysis, and provides a user comment sentiment analysis method and device, equipment, a storage medium and a product, and the method comprises the steps: obtaining a comprehensive feature vector according to a to-be-analyzed user comment, a user attribute and a social relation network between users; inputting the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction to obtain a target feature output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment mode; inputting the target features into a classifier for classification to obtain a classification result output by the classifier; wherein the classification result comprises different categories, and each category represents different user emotions. According to the invention, the adaptive phase adjustment neural network is adopted, so that the network performance is optimized; the social relationship of the user can be analyzed and fused into the model, richer information is provided to understand the emotional tendency of the user, and the emotional attitude of the user is identified and classified more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of user comment analysis, and in particular to a method, device, equipment, storage medium and product for analyzing user comment sentiment. Background Art

[0002] With the rapid development of information technology, social media and online platforms have become the main channels for users to express their opinions and feedback. For example, in the field of communications and network services, users' comments include emotional expressions on service quality, network coverage, customer service attitude and pricing strategy. These rich data resources provide operators with opportunities to deeply understand customer needs and optimize services, but they also bring huge data processing challenges.

[0003] Traditional sentiment analysis methods mainly rely on simple keyword matching or basic natural language processing techniques, which are often inaccurate when dealing with complex, ambiguous or obscure emotional expressions. In addition, these methods usually ignore users' social relationships and historical comment data, and cannot provide comprehensive sentiment analysis.

[0004] The existing technology uses neural networks to capture and analyze emotional expressions in user comments, but the analysis method of the existing technology does not fully consider the impact of user social relationships, and there are deficiencies and limitations in the analysis of subtle emotional differences in user comments. Summary of the invention

[0005] The present invention provides a user comment sentiment analysis method, device, equipment, storage medium and product to solve the technical problems in the prior art that the influence of user social relationships is not fully considered and the analysis of subtle sentiment differences in user comments is insufficient and limited.

[0006] The present invention provides a sentiment analysis method for user comments, comprising: respectively obtaining user comments to be analyzed, user attributes and social relations between users; obtaining a comprehensive feature vector according to the user comments to be analyzed, user attributes and social relation networks between users; inputting the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction to obtain target features output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; inputting the target features into a classifier for classification to obtain classification results output by the classifier; wherein the classification results include different categories, and each category represents different user emotions.

[0007] According to a sentiment analysis method for user comments provided by the present invention, a comprehensive feature vector is obtained based on the user comments to be analyzed, user attributes and the social relationship network between users, including: standardizing and vectorizing the user comments to be analyzed to obtain a user comment vector; obtaining a user feature vector based on the user attributes; obtaining a user social relationship vector based on the social relationship network between users; and cascading the user comment vector, the user feature vector and the user social relationship vector to obtain a comprehensive feature vector.

[0008] According to a sentiment analysis method for user comments provided by the present invention, a comprehensive feature vector is input into an adaptive phase adjustment neural network for feature extraction to obtain a target feature output by the neural network, including: inputting the comprehensive feature vector into a trained adaptive phase adjustment neural network for feature extraction to obtain the target feature; wherein the training process of the adaptive phase adjustment neural network includes: encoding a phase value for each parameter point in the adaptive phase adjustment neural network; initializing a parameter track for each parameter point according to the phase value; the parameter track represents the potential path of the parameter in the optimization process; during the training process, dynamically adjusting the track and speed of each parameter according to the feedback of the loss function; in each training iteration, updating the network parameters according to the adjusted track and speed until the first termination condition is met and the training is completed.

[0009] According to a sentiment analysis method for user comments provided by the present invention, a target feature is input into a classifier for classification to obtain a classification result output by the classifier, including: inputting the target feature into a trained random forest classifier based on Dirichlet allocation for classification to obtain a classification result output by the classifier; wherein the training process of the random forest classifier based on Dirichlet allocation includes: setting the number of trees of the random forest and the maximum depth of each tree, and initializing the hyperparameters of the Dirichlet distribution; randomly sampling the training data to ensure that the input data of each decision tree is not exactly the same; for each decision tree, randomly selecting a part of the features from all the features to increase the differences between the trees; using the selected features and the sampled data to construct a decision tree based on Dirichlet allocation; at each node of the decision tree, by considering the parameters of the Dirichlet distribution, selecting the optimal feature for splitting; constructing multiple decision trees, integrating the outputs of all the trees into a final classification result; using a verification set to verify the final classification result to obtain a verification result, and adjusting the classifier based on the verification result until the second termination condition is met to complete the training.

[0010] According to a sentiment analysis method of user comments provided by the present invention, user social relationship vectors are obtained according to the social relationship network between users, including: obtaining a user social relationship vector set based on the social relationship network and adopting the node2vec algorithm and the Skip-gram model training; generating and training a node sequence based on the user social relationship vector set to obtain the user social relationship vector; wherein the user social relationship vector is used to represent the user's personalized information, position in the social network, and degree of association with other users.

[0011] According to a sentiment analysis method of user comments provided by the present invention, a user feature vector is obtained according to user attributes, including: obtaining an attribute vector according to the user attributes; obtaining a historical comment vector according to the user's historical comments; and obtaining a user feature vector according to the attribute vector and the historical comment vector.

[0012] The present invention also provides a sentiment analysis device for user comments, including: a data acquisition module, used to respectively acquire user comments to be analyzed, user attributes and social relations between users; a feature vector module, used to obtain a comprehensive feature vector based on the user comments to be analyzed, user attributes and social relationship networks between users; a feature extraction module, used to input the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction, and obtain target features output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; a sentiment classification module, used to input the target features into a classifier for classification, and obtain classification results output by the classifier; wherein the classification results include different categories, and each category represents different user emotions.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a sentiment analysis method for user comments as described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for sentiment analysis of user comments.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for sentiment analysis of user comments as described above is implemented.

[0016] The user comment sentiment analysis method, device, equipment, storage medium and product provided by the present invention include: obtaining the user comments to be analyzed, user attributes and social relations between users respectively; obtaining a comprehensive feature vector according to the user comments to be analyzed, user attributes and social relations network between users; inputting the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction to obtain the target feature output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; inputting the target feature into a classifier for classification to obtain a classification result output by the classifier; wherein the classification result includes different categories, each category representing different user emotions. In the above manner, the present invention analyzes the user social relationship and integrates it into the input of the model, so that the sentiment classification not only depends on the user's comment content, but also considers the user's position in the social network and the relationship with other users, increases the context perception ability of the sentiment classification, and can obtain more accurate classification results; through the innovative training method of the adaptive phase adjustment neural network, the network can more effectively capture the subtle emotional differences in user comments, optimize the network performance, and can more accurately identify and classify the user's emotional attitude in a shorter time. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.

[0018] Figure 1 It is a flowchart of a sentiment analysis method for user comments provided by an embodiment of the present invention.

[0019] Figure 2 It is a flowchart of the adaptive phase adjustment neural network training process provided by an embodiment of the present invention.

[0020] Figure 3 It is a flowchart of a random forest classifier training process based on Dirichlet allocation provided by an embodiment of the present invention.

[0021] Figure 4 This is the second flow chart of the method for sentiment analysis of user comments provided by an embodiment of the present invention.

[0022] Figure 5 It is a structural schematic diagram of a sentiment analysis device for user comments provided by an embodiment of the present invention.

[0023] Figure 6It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0026] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0027] The main problems of user comment sentiment classification in related technologies are as follows: 1. Traditional neural networks may have limitations in capturing and analyzing subtle emotional differences in user comments, and their training methods and network structures are not sufficient to effectively process complex emotional expressions.

[0028] 2. Traditional classification algorithms may have shortcomings in adapting to the relationship between different sentiment classification categories and improving model robustness.

[0029] 3. The impact of user social relationships on sentiment analysis may not be fully considered.

[0030] 4. The feature extraction may be too simplified or single, and all available information may not be fully utilized to improve the accuracy and depth of sentiment classification.

[0031] Based on this, the present invention provides a sentiment analysis method for user comments, please refer to Figure 1 , Figure 1: is a flow chart of a method for analyzing sentiment of user comments provided by an embodiment of the present invention. In this embodiment, the method for analyzing sentiment of user comments may include steps S110 to S140, and each step is specifically as follows: S110: Obtaining user comments to be analyzed, user attributes, and social relationships between users respectively.

[0032] S120: Obtain a comprehensive feature vector based on the user comments to be analyzed, user attributes, and the social relationship network between users.

[0033] S130: Inputting the comprehensive feature vector into the adaptive phase adjustment neural network for feature extraction to obtain target features output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method.

[0034] S140: Input the target feature into a classifier for classification, and obtain a classification result output by the classifier; wherein the classification result includes different categories, and each category represents a different user emotion.

[0035] The user comment sentiment analysis method provided by the embodiment of the present invention uses an innovative training method of an adaptive phase-adjusted neural network, so that the network can more effectively capture subtle emotional differences in user comments. Compared with traditional neural networks, this method optimizes network performance by dynamically adjusting the "track" of neural network weights and biases. Therefore, this embodiment can more accurately identify and classify users' emotional attitudes in a shorter time; and this embodiment analyzes user social relationships and incorporates them into the model, so that sentiment classification not only depends on the content of the user's comments, but also takes into account the user's position in the social network and the relationship with other users. This increases the context-awareness of sentiment classification and provides richer information to understand users' emotional tendencies.

[0036] In some embodiments, the step of obtaining a comprehensive feature vector based on the user comments to be analyzed, user attributes, and the social relationship network between users can specifically include: standardizing and vectorizing the user comments to be analyzed to obtain a user comment vector; obtaining a user feature vector based on the user attributes; obtaining a user social relationship vector based on the social relationship network between users; and cascading the user comment vector, the user feature vector, and the user social relationship vector to obtain a comprehensive feature vector.

[0037] Based on any of the above embodiments, the step of obtaining a user social relationship vector according to a social relationship network between users may specifically include: obtaining a user social relationship vector set based on the social relationship network and using a node2vec algorithm and a Skip-gram model for training; generating and training a node sequence based on the user social relationship vector set to obtain a user social relationship vector; wherein the user social relationship vector is used to represent the user's personalized information, position in the social network, and degree of association with other users.

[0038] Based on any of the above embodiments, the step of obtaining a user feature vector according to user attributes may specifically include: obtaining an attribute vector according to user attributes; obtaining a historical comment vector according to the user's historical comments; and obtaining a user feature vector according to the attribute vector and the historical comment vector.

[0039] In this embodiment, the feature vector for sentiment classification is generated by integrating the user's historical comments, attribute features, and social relationships. This comprehensive feature extraction method makes sentiment classification more comprehensive and accurate, and can better capture the multi-dimensional features of user emotions.

[0040] Based on any of the above embodiments, the step of inputting the comprehensive feature vector into the adaptive phase adjustment neural network for feature extraction to obtain the target feature output by the neural network may specifically include: The comprehensive feature vector is input into the trained adaptive phase adjustment neural network for feature extraction to obtain the target feature; wherein, the training process of the adaptive phase adjustment neural network includes: encoding a phase value for each parameter point in the adaptive phase adjustment neural network; initializing a parameter track for each parameter point according to the phase value; the parameter track represents the potential path of the parameter in the optimization process; during the training process, the track and speed of each parameter are dynamically adjusted according to the feedback of the loss function; in each training iteration, the network parameters are updated according to the adjusted track and speed until the first termination condition is met and the training is completed.

[0041] In this embodiment, an adaptive phase adjustment neural network is proposed, which can be a 3-layer fully connected neural network. The data input to the adaptive phase adjustment neural network is the comprehensive data after cascading the user's historical comment vector representation, user feature vector, and user social relationship vector. The data integrates the user's personalized features, social network features, and their attitude and feedback on the service.

[0042] Inspired by the phase adjustment mechanism of celestial motion and fluctuation, in astrophysics, the motion of celestial bodies follows precise mathematical laws, and their orbits and speeds can be predicted and calculated. The adaptive phase adjustment neural network simulates this mechanism and optimizes network performance by adjusting the "orbit" of the neural network weights and biases. Different from the traditional gradient descent parameter optimization method, the method of this embodiment does not rely on the traditional gradient descent algorithm, but optimizes the network by adjusting the motion trajectory and speed of the parameters.

[0043] Since operator user sentiment classification tasks usually involve understanding and analyzing subtle sentiment differences in unstructured text data, the adaptive phase adjustment neural network can effectively capture these subtle sentiment features, such as the tone, context, and implicit meaning of user comments, through its complex network structure and parameter optimization mechanism.

[0044] In addition, one of the challenges in sentiment classification is the diversity and variability of text data. The dynamic phase adjustment mechanism of the adaptive phase adjustment neural network enables it to adapt to the expression styles of different users, the expression methods of different emotions and their changes, thereby improving the accuracy and robustness of classification.

[0045] By cascading user historical comments, features, and social relationship vectors, the adaptive phase adjustment neural network can comprehensively consider multiple factors that affect user emotional expression and achieve more accurate emotional classification. In practical applications, the method of this embodiment can help better understand customer needs, improve customer satisfaction, and optimize service strategies.

[0046] Specifically, the difference between the training methods of adaptive phase adjustment neural networks and traditional neural networks is that the adaptive phase adjustment neural network is trained by dynamic phase adjustment of parameters, that is, the adjustment of each parameter is not static, but dynamically changes according to the current network state, imitating the dynamic balance of celestial motion; in addition, the parameter update path in traditional methods is usually directly moving towards the goal (such as minimizing the loss function), in the adaptive phase adjustment neural network, the parameter update trajectory is designed to be similar to the orbit of celestial motion, which can circle multiple "gravitational points", which represent different local optimal areas; at the same time, similar to the speed change of celestial motion, the parameter update speed in the adaptive phase adjustment neural network will automatically adjust according to the current position and target distance to achieve more precise optimization; and, drawing on the global and local gravitational balance in celestial motion, the adaptive phase adjustment neural network aims to achieve a balance between local optimality and global optimality.

[0047] See also Figure 2 , Figure 2 It is a flowchart of the adaptive phase adjustment neural network training process provided by an embodiment of the present invention.

[0048] S210: Phase encoding.

[0049] In the adaptive phase adjustment neural network, each data point is encoded as a phase value, that is, the data features are mapped into a predefined phase range, such as mapping into the range of 0 to 2π.

[0050] Specifically, suppose the cascade data input into the neural network is: ; For each data point Encode a phase value , mapped to the range of [0, 2π], can be expressed as: ; in, is a small constant used to adjust the nonlinear characteristics of phase change. In one embodiment, is set to 0.1.

[0051] S220: Track initialization.

[0052] For each parameter in the neural network, a parameter track is initialized according to its phase value, which represents the potential path of the parameter during the optimization process.

[0053] Specifically, for each parameter in the neural network , according to its phase value Initialize a parameter track , which can be expressed as: ; in, and is a hyperparameter of the trajectory shape. In one embodiment, and is set to 1.

[0054] S230: Dynamic adjustment.

[0055] During the neural network training process, the orbit and speed of each parameter are dynamically adjusted according to the feedback of the loss function. This process imitates the dynamic phase adjustment in the motion of celestial bodies.

[0056] Specifically, the trajectory parameters are dynamically adjusted according to the feedback of the loss function L and And speed , which can be expressed as: ; ; ; in, is a hyperparameter related to the learning rate. , as well as is the parameter before adjustment, , as well as is the adjusted parameter.

[0057] In one embodiment, Set to 0.1, 0.1, and 0.01 respectively.

[0058] In one embodiment, the loss function L is a cross entropy loss function, which is obtained based on a preset Softmax classifier.

[0059] S240: Parameter update.

[0060] In each training iteration, the network parameters are updated according to the adjusted orbit and velocity to simulate the motion trajectory of celestial bodies under the influence of gravity, so as to achieve the purpose of gradual optimization.

[0061] Specifically, in each iteration, the way to update the network parameters according to the adjusted trajectory and rate can be expressed as: ; in, is the parameter before updating; is the updated parameter.

[0062] is the time step, which is a hyperparameter and can be set to 1 in one embodiment.

[0063] M is the momentum coefficient, is a regularization coefficient used to control the update step size and prevent overfitting. In one embodiment, M is set to 0.9. Set to 0.001.

[0064] S250: Iterative optimization.

[0065] Repeat the above steps S230 to S250 until a termination condition is met, such as reaching a preset number of iterations or the loss function drops to a preset threshold.

[0066] Based on any of the above embodiments, the step of inputting the target feature into a classifier for classification and obtaining a classification result output by the classifier may specifically include: The target feature is input into a trained random forest classifier based on Dirichlet allocation for classification, and the classification result output by the classifier is obtained; wherein, the training process of the random forest classifier based on Dirichlet allocation includes: setting the number of trees of the random forest and the maximum depth of each tree, and initializing the hyperparameters of the Dirichlet distribution; randomly sampling the training data to ensure that the input data of each decision tree is not exactly the same; for each decision tree, a part of the features is randomly selected from all the features to increase the differences between the trees; using the selected features and the sampled data, a decision tree based on Dirichlet allocation is constructed; at each node of the decision tree, by considering the parameters of the Dirichlet distribution, the optimal feature is selected for splitting; multiple decision trees are constructed, and the outputs of all the trees are integrated into the final classification result; the final classification result is verified using a verification set to obtain a verification result, and the classifier is adjusted based on the verification result until the second termination condition is met and the training is completed.

[0067] In this embodiment, the random forest classification algorithm based on Dirichlet allocation introduces Dirichlet distribution as a priori, so that the model can more flexibly adapt to the complex relationship between different sentiment classification categories. This not only improves the stability of the model when facing different types of data, but also enhances the generalization ability of the model on new or unseen data.

[0068] Specifically, in the process of inputting the feature-extracted data into the classifier for training, this embodiment proposes a random forest classification algorithm based on Dirichlet allocation, introduces Dirichlet distribution as a priori, and is used to model the probability distribution of the sentiment classification categories of user comments of each operator in the classifier, so that the algorithm can more flexibly adapt to the relationship between different sentiment classification categories, thereby improving the robustness and generalization ability of the model.

[0069] In addition, this embodiment uses the parameters of the Dirichlet distribution to adjust the weights of features. By making targeted selections of features, the classifier's attention to important features is increased, overfitting of irrelevant features is reduced, and model performance is improved.

[0070] See also Figure 3 , Figure 3 It is a flowchart of a random forest classifier training process based on Dirichlet allocation provided by an embodiment of the present invention.

[0071] S310: Initialize parameters.

[0072] The number of random forest trees, the maximum depth of each tree, and other parameters are set, and the hyperparameters of the Dirichlet distribution are initialized. In one embodiment, the hyperparameters of the Dirichlet distribution are set is 5, the number of trees N_trees is 100, and the maximum depth Max_depth of each tree is 10.

[0073] S320: Random sampling of data.

[0074] The training data is randomly sampled to ensure that the input data of each decision tree is not exactly the same. Specifically, let D be the training data set input into the random forest based on Dirichlet allocation, which can be expressed as: ; in is the feature of the ath sample, Its corresponding label is a=1,2,…,m.

[0075] Furthermore, a subset is obtained by random sampling , which can be expressed as: ; Among them, k<m.

[0076] S330: Random feature selection.

[0077] For each decision tree, a portion of features are randomly selected from all features to increase the diversity between trees.

[0078] Specifically, let the original feature set be ; The randomly selected feature subset is , where p<n.

[0079] In one embodiment, the original feature set is a 20-dimensional feature vector output by the neural network. Specifically, the 20-dimensional eigenvector values ​​in this embodiment are: [0.45, -0.88, 0.67, 0.32, -0.21, 0.58, -0.73, 0.14, 0.85, -0.49, 0.8829, 0.6231, 0.9506, 0.2979, 0.9543, 0.5783,0.0543, 0.2744, 0.7377, 0.5091].

[0080] Furthermore, in this embodiment, the randomly selected feature subset is: .

[0081] S340: Tree construction.

[0082] Using the selected features and sampled data, a decision tree based on Dirichlet allocation is constructed. At each node, the optimal feature is selected for splitting by considering the parameters of Dirichlet distribution.

[0083] Specifically, suppose the data set of a node is , the parameters of the Dirichlet distribution are , the impurity measure of the node is the Gini index, which is expressed as: ; Among them, G() is the Gini index calculation function, C is the number of categories, is the probability of the i-th category. The goal of node splitting is to minimize the weighted Gini index, which can be expressed as: ; in, is the node splitting standard function, represents the value set of feature f, represents the subset whose value is v on feature f.

[0084] Furthermore, when selecting the optimal feature for splitting, in order to specifically calculate the effect of the split, it is necessary to calculate the weighted Gini index difference before and after the split. The calculation function Imp() can be expressed as: ; in, and It is the data set of the left and right child nodes after the node is split.

[0085] S350: Ensembles of random forests.

[0086] Repeat steps S320 to S340 to construct multiple decision trees. Finally, the outputs of all trees are integrated into the final classification result. Specifically, there are N trees, and the output of each tree is C1, C2, ..., C N , the integrated result is: ; Among them, Majority_Vote means that the majority vote determines the final classification result, and Ensemble_Result means the final integration result.

[0087] Furthermore, when performing majority voting, the weight of each tree is introduced, and the weight of each tree is set to W1, W2, ..., W N , then the final classification result determined by majority voting can be expressed as: ; in, is an indicator function, which means it is 1 if the condition is met, otherwise it is 0.

[0088] S360: Model optimization.

[0089] Use the validation set to tune the model, including adjusting the hyperparameters of the Dirichlet distribution , random forest parameters N_trees and Max_depth, etc., to achieve the best performance.

[0090] S370: Classifier training is completed.

[0091] After several rounds of random data sampling, random feature selection and tree construction, a random forest classifier based on Dirichlet allocation with strong generalization ability was trained.

[0092] See also Figure 4 , Figure 4 This is the second flow chart of the method for analyzing the sentiment of user comments provided by an embodiment of the present invention. In this embodiment, the method for analyzing the sentiment of user comments may include steps S410 to S460, each of which is as follows: S410: Data collection and preprocessing.

[0093] This embodiment performs sentiment classification on comments from operator users. The collected data is the comment data of operator users. The comment data is collected from multiple operators' online platforms and social media websites. The collected data mainly includes user feedback, opinions, complaints, etc. on operator services. In the collection process, in order to ensure the representativeness and diversity of the data, this embodiment collects comments from users of different regions, ages and backgrounds.

[0094] Specifically, the collected review text can be expressed as: ; in, represents the comment text of the i-th user, and N is the total number of comments collected.

[0095] Furthermore, the collected data are annotated manually, and the annotated categories include positive comments, negative comments, suggestions and opinions, complaints, inquiries, and neutral comments.

[0096] Positive reviews refer to users' satisfaction with the operator's services, which may include positive comments on network coverage, customer service, price, etc.

[0097] Negative reviews refer to users’ dissatisfaction with the operator’s services, which may include negative comments on network problems, poor customer service attitude, high prices, etc.

[0098] Suggestions and comments refer to suggestions or opinions put forward by users, hoping that operators will make improvements in certain aspects or provide new services.

[0099] A complaint refers to a user's specific dissatisfaction or complaint about the operator's services, which may involve service quality, network failure, billing issues, etc.

[0100] A query refers to questions or problems raised by users, which may be inquiries regarding bills, packages, service coverage, etc.

[0101] A neutral comment means that the user's comment does not express strong positive or negative emotions. It may be an objective description, an information inquiry, or a simple statement.

[0102] In one embodiment, 10,000 comments were collected, covering different service types and user groups. The data types include positive evaluations, negative complaints, suggestions, and queries. Among them, one of the collected comments is: "The network coverage is good, the customer service attitude is nice, but the price is a bit high."

[0103] Furthermore, the collected comment texts usually contain various formats and unstructured information. For ease of processing, it is necessary to standardize them. The standardization process includes converting the text to a unified encoding format (such as converting to UTF-8 format), ensuring the cleanliness of the text, and unifying the length of the comment texts.

[0104] Furthermore, the standardized comment texts are further processed by word segmentation, which is the process of splitting continuous text into individual words or phrases.

[0105] In one embodiment, after word segmentation of the comment "The network coverage is good, the customer service attitude is nice, but the price is a bit high", the resulting data is represented as: ["network", "coverage", "good", ",", "customer service", "attitude", "nice", ",", "but", "price", "a bit", "high"].

[0106] Furthermore, stop words (such as common words like "de" (的 in Chinese), "shi" (是 in Chinese) that contribute less to sentiment analysis) are removed to reduce the noise in processing and improve the efficiency and accuracy of subsequent steps. Specifically, the comment text after word segmentation and stop word removal is represented as .

[0107] In one embodiment, after performing the stop word removal operation on the data representation ["network", "coverage", "good", ",", "customer service", "attitude", "nice", ",", "but", "price", "a bit", "high"] after word segmentation, the resulting data representation is: ["network", "coverage", "good", "customer service", "attitude", "nice", "price", "a bit", "high"].

[0108] Furthermore, each comment is converted into a word sequence to meet the input requirements of machine learning models.

[0109] In one embodiment, the data representation ["network", "coverage", "good", "customer service", "attitude", "good", "price", "slightly", "high"] after the stop word operation is removed is converted into a word sequence, and the conversion method adopts the Word2Vec method. The converted data is represented as follows: "Network" -> [0.12, -0.56, 0.32]; "cover" -> [-0.23, 0.81, -0.59]; "Not bad" -> [0.47, -0.27, 0.15]; "Customer Service" -> [-0.31, 0.58, -0.76]; "attitude" -> [0.29, -0.45, 0.88]; "good" -> [-0.15, 0.72, 0.67]; "price" -> [0.33, -0.68, -0.45]; "slightly" -> [-0.44, 0.12, 0.85]; "High" -> [0.56, -0.33, -0.74]; Therefore, the vector representation of the entire sentence of the comment "The network coverage is good, the customer service attitude is very good, but the price is a little high" is: [0.12, -0.56, 0.32, -0.23, 0.81, -0.59, 0.47, -0.27, 0.15, -0.31, 0.58, -0.76, 0.29, -0.45, 0.88, -0.15, 0.72, 0.67, 0.33, -0.68, -0.45, -0.44, 0.12,0.85, 0.56, -0.33, -0.74].

[0110] S420: Feature extraction.

[0111] Extract key features from the preprocessed user comment data for subsequent sentiment classification. First, analyze the user's historical comments to extract features. This process is based on the following two preset conditions: Precondition 1: User's current comment represents the jth current comment of user i; Precondition 2: User review set Contains all comments made by a user within a certain period of time.

[0112] In order to extract features from user historical comments, the present invention first generates a historical comment vector. For user i, its historical comment vector It is calculated by the following formula: ; Among them, mean() is the mean calculation function. is the sentence vector of the jth comment of user i, calculated as follows: ; in, is the word ijk The word vector, T k is the tf-idf value of the word.

[0113] Furthermore, the user attribute vector is generated, and the attribute vector of user i is From its attribute characteristics F i Extracted as follows: ; in, is the j-th attribute value of user i.

[0114] Furthermore, a user feature vector is generated. It is the concatenation of the historical review vector and the attribute vector, which can be expressed as: ; In one embodiment, for the historical comment vector of the i-th user It can be expressed as: [0.8474, 0.4756, 0.7720, 0.4886, 0.2586, 0.9015, 0.8026, 0.4905, 0.1201, 0.5890], for the attribute vector of the i-th user It can be expressed as: [0.9983, 0.2715, 0.6173, 0.3036, 0.7329, 0.1515, 0.6518, 0.2853], then the user feature vector can be expressed as: [0.8474, 0.4756, 0.7720,0.4886, 0.2586, 0.9015, 0.8026, 0.4905, 0.1201, 0.5890, 0.9983, 0.2715,0.6173, 0.3036, 0.7329, 0.1515, 0.6518, 0.2853].

[0115] Furthermore, the social relations between users are analyzed to extract features. The present invention uses the node2vec algorithm to learn the structure of the user social relationship network and generate the user social relationship vector. This process is based on the following preset conditions: Precondition 3: The social relationship between users is represented by G = (V, A), where V is the user set and A is the user's adjacency matrix.

[0116] In the process of generating user social relationship vectors, the social relationship vectors are first generated. The present invention uses the node2vec algorithm to learn the user social relationship network G, and obtains the user social relationship vector set through Skip-gram model training. .

[0117] Furthermore, node sequence generation and training are performed, and the objective function of the training process is: ; in, Calculated by the following formula: .

[0118] In one embodiment, the obtained user social relationship vector is: [0.2157, 0.5377, 0.4927, 0.8017, 0.9215, 0.3666, 0.7158, 0.0892, 0.2316, 0.0236, 0.3072, 0.2892].

[0119] Based on this, valuable features can be extracted from users' historical comments and social relationships. These features not only reflect users' personalized information, such as word usage habits, personality traits, attitude preferences, etc., but also include users' social relationship information, such as their position in the social network and the degree of connection with other users.

[0120] S430: Generation of feature vectors.

[0121] Combine the user's historical comments, attribute features and social relations to generate a comprehensive feature vector for sentiment classification. In this embodiment, the user's historical comment vector representation, the user feature vector and the user's social relationship vector are first cascaded.

[0122] In one embodiment, the user historical review vector is represented as: [0.12, -0.56, 0.32, -0.23, 0.81, -0.59, 0.47, -0.27, 0.15, -0.31, 0.58, -0.76, 0.29, -0.45, 0.88, -0.15, 0.72, 0.67, 0.33, -0.68, -0.45, -0.44, 0.12, 0.85, 0.56, -0.33, -0.74].

[0123] The user feature vector is represented as: [0.8474, 0.4756, 0.7720, 0.4886, 0.2586, 0.9015,0.8026, 0.4905, 0.1201, 0.5890, 0.9983, 0.2715, 0.6173, 0.3036, 0.7329,0.1515, 0.6518, 0.2853].

[0124] The user social relationship vector is expressed as: [0.2157, 0.5377, 0.4927, 0.8017, 0.9215, 0.3666, 0.7158, 0.0892, 0.2316, 0.0236, 0.3072, 0.2892].

[0125] Furthermore, the user historical comment vector representation, user feature vector, and user social relationship vector are concatenated and normalized to obtain the following vector: [0.0291, -0.1358, 0.0776, -0.0558, 0.1964, -0.1431, 0.1140, -0.0655, 0.0364, -0.0752, 0.1406, -0.1843, 0.0703, -0.1091,0.2134, -0.0364, 0.1746, 0.1624, 0.0800, -0.1649, -0.1091, -0.1067, 0.0291,0.2061, 0.1358, -0.0800, 0.0523, 0.1304, 0.1195, 0.1944, 0.2234,0.0889, 0.1736, 0.0216, 0.0562, 0.0057, 0.0745, 0.0701].

[0126] S440: Neural network feature extraction model training.

[0127] The number of neurons in the third layer of the neural network can be 20, that is, the data input to the neural network is converted into a 20-dimensional feature vector f1, f2, ..., f 20 .

[0128] In one embodiment, the data input to the neural network is: [0.0291, -0.1358, 0.0776, -0.0558, 0.1964, -0.1431, 0.1140, -0.0655, 0.0364, -0.0752, 0.1406, -0.1843,0.0703, -0.1091, 0.2134, -0.0364, 0.1746, 0.1624, 0.0800, -0.1649, -0.1091, -0.1067, 0.0291, 0.2061, 0.1358, -0.0800, -0.1794, 0.2055, 0.1153, 0.1872,0.1185, 0.0627, 0.2186, 0.1946, 0.1189, 0.0291, 0.1428, 0.2420, 0.0658,0.1497, 0.0736, 0.1777, 0.0367, 0.1580, 0.0692, 0.0523, 0.1304, 0.1195,0.1944, 0.2234, 0.0889, 0.1736, 0.0216, 0.0562, 0.0057, 0.0745, 0.0701], the vector after feature extraction converted to 20 dimensions is: [0.45, -0.88, 0.67, 0.32, -0.21, 0.58, -0.73,0.14, 0.85, -0.49, 0.8829, 0.6231, 0.9506, 0.2979, 0.9543, 0.5783, 0.0543,0.2744, 0.7377, 0.5091].

[0129] S450: Classification model training.

[0130] After several rounds of random sampling of data, random selection of features and construction of trees, a random forest classifier based on Dirichlet allocation with strong generalization ability is trained. In one embodiment, 100 decision trees are constructed, and the output of each tree is a certain category. The final classification result is determined by majority voting. In this embodiment, the output categories may be: positive evaluation, negative evaluation, suggestions and opinions, complaints, inquiries, neutral comments, corresponding to classification labels 0, 1, 2, 3, 4, 5 respectively.

[0131] S460: User review sentiment classification.

[0132] After the feature extraction and classification model training are completed, the trained model is used to perform sentiment classification of operator user comments.

[0133] Specifically, for a new sample, first perform data preprocessing to standardize the new comment sample. Further, perform word segmentation on the comment to split the continuous text into individual words or phrases. Further, remove common words that are not very helpful for sentiment analysis, such as "de" (的), "shi" (是), etc., to reduce noise and improve processing efficiency. Further, generate a comprehensive feature vector. Further, input the comprehensive feature vector into the trained adaptive phase adjustment neural network for feature extraction. Further, input the feature vector output by the neural network into the trained random forest classifier based on Dirichlet allocation for classification.

[0134] In summary, the embodiment of the present invention provides a method for sentiment analysis of user comments, having the following technical effects: 1. Adopt the training method of the adaptive phase adjustment neural network: Compared with the traditional neural network, the adaptive phase adjustment neural network simulates the phase adjustment mechanism of celestial body motion, and optimizes the network performance by dynamically adjusting the "orbits" of the neural network weights and biases. This way enables the network to more effectively capture and analyze the subtle sentiment differences in user comments, thereby improving the accuracy and efficiency of sentiment classification.

[0135] 2. Adopt the random forest classification algorithm based on Dirichlet allocation: Introduce the Dirichlet distribution as a prior to more flexibly adapt to the relationships between different sentiment classification categories, not only improving the robustness and generalization ability of the model, but also increasing the attention of the classifier to important features by targeted selection of features, and reducing overfitting to irrelevant features.

[0136] 3. Analyze the social relationships between users through the node2vec algorithm to generate user social relationship vectors, enabling the model to consider not only the comment content of users, but also the positions of users in the social network and the degree of association with other users.

[0137] 4. Comprehensively consider the historical comments, attribute features, and social relationships of users to generate a comprehensive feature vector for sentiment classification. The comprehensive feature extraction method makes sentiment classification more comprehensive and accurate.

[0138] The present invention also provides a device for sentiment analysis of user comments. The device for sentiment analysis of user comments provided by the present invention will be described below. The device for sentiment analysis of user comments described below can be mutually corresponding and referred to the method for sentiment analysis of user comments described above.

[0139] Please refer to Figure 5 , Figure 55 is a schematic diagram of the structure of the device for analyzing the sentiment of user comments provided by an embodiment of the present invention. In this embodiment, the device for analyzing the sentiment of user comments may include a data acquisition module 510 , a feature vector module 520 , a feature extraction module 530 and a sentiment classification module 540 .

[0140] The data acquisition module 510 is used to respectively acquire user comments, user attributes and social relationships between users to be analyzed.

[0141] The feature vector module 520 is used to obtain a comprehensive feature vector based on the user comments to be analyzed, the user attributes and the social relationship network between users.

[0142] The feature extraction module 530 is used to input the comprehensive feature vector into the adaptive phase adjustment neural network for feature extraction to obtain the target feature output by the neural network; the adaptive phase adjustment neural network is trained by adopting the method of dynamic phase adjustment of parameters.

[0143] The emotion classification module 540 is used to input the target feature into the classifier for classification, and obtain the classification result output by the classifier; wherein the classification result includes different categories, and each category represents different user emotions.

[0144] Based on any of the above embodiments, the feature vector module 520 can be specifically used to: standardize and vectorize the user comments to be analyzed to obtain a user comment vector; obtain a user feature vector based on user attributes; obtain a user social relationship vector based on the social relationship network between users; cascade the user comment vector, user feature vector and user social relationship vector to obtain a comprehensive feature vector.

[0145] Based on any of the above embodiments, the feature extraction module 530 can be specifically used to: input the comprehensive feature vector into the trained adaptive phase adjustment neural network for feature extraction to obtain the target feature; wherein the training process of the adaptive phase adjustment neural network includes: encoding a phase value for each parameter point in the adaptive phase adjustment neural network; initializing a parameter track for each parameter point based on the phase value; the parameter track represents the potential path of the parameter in the optimization process; during the training process, dynamically adjusting the track and speed of each parameter based on the feedback of the loss function; in each training iteration, updating the network parameters based on the adjusted track and speed until the first termination condition is met and the training is completed.

[0146] Based on any of the above embodiments, the sentiment classification module 540 can be specifically used to: input the target feature into a trained random forest classifier based on Dirichlet allocation for classification, and obtain the classification result output by the classifier; wherein the training process of the random forest classifier based on Dirichlet allocation includes: setting the number of trees in the random forest and the maximum depth of each tree, and initializing the hyperparameters of the Dirichlet distribution; randomly sampling the training data to ensure that the input data of each decision tree is not exactly the same; for each decision tree, randomly selecting a part of the features from all the features to increase the differences between the trees; using the selected features and the sampled data to build a decision tree based on Dirichlet allocation; at each node of the decision tree, by considering the parameters of the Dirichlet distribution, selecting the optimal feature for splitting; constructing multiple decision trees, and integrating the outputs of all the trees into the final classification result; using the verification set to verify the final classification result to obtain the verification result, and adjusting the classifier parameters based on the verification result until the second termination condition is met and the training is completed.

[0147] Based on any of the above embodiments, the feature vector module 520 can be specifically used to: obtain a user social relationship vector set based on a social relationship network and using the node2vec algorithm and Skip-gram model training; generate and train a node sequence based on the user social relationship vector set to obtain a user social relationship vector; wherein the user social relationship vector is used to represent the user's personalized information, position in the social network, and degree of association with other users.

[0148] Based on any of the above embodiments, the characteristic vector module 520 can be specifically used to: obtain an attribute vector according to user attributes; obtain a historical comment vector according to the user's historical comments; and obtain a user characteristic vector according to the attribute vector and the historical comment vector.

[0149] In summary, the embodiment of the present invention provides a sentiment analysis device for user comments, including: a data acquisition module, used to respectively acquire user comments to be analyzed, user attributes and social relations between users; a feature vector module, used to obtain a comprehensive feature vector according to the user comments to be analyzed, user attributes and social relations network between users; a feature extraction module, used to input the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction, and obtain the target feature output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; a sentiment classification module, used to input the target feature into a classifier for classification, and obtain the classification result output by the classifier; wherein the classification result includes different categories, and each category represents different user emotions. In the above manner, the embodiment of the present invention analyzes the user social relationship and integrates it into the input of the model, so that the sentiment classification not only depends on the user's comment content, but also considers the user's position in the social network and the relationship with other users, increases the context perception ability of the sentiment classification, and can obtain more accurate classification results; through the innovative training method of the adaptive phase adjustment neural network, the network can more effectively capture the subtle emotional differences in user comments, optimize the network performance, and can more accurately identify and classify the user's emotional attitude in a shorter time.

[0150] On the other hand, an embodiment of the present invention further provides an electronic device, see Figure 6 , Figure 6 Schematic diagram of the physical structure of the electronic device provided by the embodiment of the present invention. Figure 6 As shown, the electronic device may include: the electronic device may include a memory 620, a processor 610, and a computer program stored in the memory 620 and executable on the processor 610. When the processor 610 executes the program, the sentiment analysis method of user comments provided by the above methods is implemented.

[0151] Optionally, the electronic device may further include a communication bus 630 and a communication interface (CommunicationsInterface) 640, wherein the processor 610, the communication interface 640, and the memory 620 communicate with each other via the communication bus 630. The processor 610 may call a computer program in the memory 620 to execute a method for analyzing sentiment of user comments, which may include: The user comments, user attributes and social relations between users to be analyzed are obtained respectively; a comprehensive feature vector is obtained according to the user comments, user attributes and social relation network between users to be analyzed; the comprehensive feature vector is input into an adaptive phase adjustment neural network for feature extraction to obtain the target feature output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; the target feature is input into a classifier for classification to obtain the classification result output by the classifier; wherein the classification result includes different categories, and each category represents different user emotions.

[0152] In addition, the logic instructions in the above-mentioned memory 620 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0153] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the sentiment analysis method of user comments provided by the above methods. The steps and principles have been introduced in detail in the above methods and will not be repeated here.

[0154] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the sentiment analysis method of user comments provided by the above methods is implemented. The steps and principles of the sentiment analysis method have been introduced in detail in the above methods and will not be repeated here.

[0155] Non-transitory computer-readable storage media can be any available media or data storage devices that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drives (SSDs)), etc.

[0156] In summary, the user comment sentiment analysis method, device, equipment, storage medium and product provided by the embodiments of the present invention include: respectively obtaining the user comments to be analyzed, user attributes and social relations between users; obtaining a comprehensive feature vector based on the user comments to be analyzed, user attributes and social relationship network between users; inputting the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction to obtain the target feature output by the neural network; the adaptive phase adjustment neural network is trained by dynamic phase adjustment of parameters; inputting the target feature into a classifier for classification to obtain the classification result output by the classifier; wherein the classification result includes different categories, each category representing different user emotions. Through the above method, the embodiment of the present invention adopts an adaptive phase adjustment neural network to optimize network performance; it is able to analyze user social relations and integrate them into the model, providing richer information to understand the user's emotional tendencies, and more accurately identify and classify the user's emotional attitudes.

[0157] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0158] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A sentiment analysis method for user comments, characterized in that: include: Obtain the user comments, user attributes and social relationships between users to be analyzed respectively; Obtaining a comprehensive feature vector according to the user comments to be analyzed, the user attributes and the social relationship network between the users; The comprehensive feature vector is input into an adaptive phase adjustment neural network for feature extraction to obtain target features output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; The target feature is input into a classifier for classification, and a classification result output by the classifier is obtained; wherein the classification result includes different categories, and each category represents a different user emotion.

2. The method for sentiment analysis of user comments according to claim 1, characterized in that: The step of obtaining a comprehensive feature vector based on the user comments to be analyzed, the user attributes and the social relationship network between the users includes: Standardizing and vectorizing the user comments to be analyzed to obtain user comment vectors; Obtaining a user feature vector according to the user attributes; Obtaining a user social relationship vector according to the social relationship network between the users; The user comment vector, the user feature vector and the user social relationship vector are cascaded to obtain the comprehensive feature vector.

3. The method for sentiment analysis of user comments according to claim 1 or 2, characterized in that: The step of inputting the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction to obtain target features output by the neural network includes: Inputting the comprehensive feature vector into a trained adaptive phase adjustment neural network for feature extraction to obtain the target feature; The training process of the adaptive phase adjustment neural network includes: encoding a phase value for each parameter point in the adaptive phase adjustment neural network; Initializing a parameter track for each parameter point according to the phase value; the parameter track represents a potential path of the parameter during the optimization process; During training, the trajectory and speed of each parameter are dynamically adjusted based on the feedback of the loss function; In each training iteration, the network parameters are updated according to the adjusted trajectory and speed until the first termination condition is met and the training is completed.

4. The method for sentiment analysis of user comments according to claim 1 or 2, characterized in that: The step of inputting the target feature into a classifier for classification to obtain a classification result output by the classifier includes: Inputting the target feature into a trained random forest classifier based on Dirichlet allocation for classification, and obtaining a classification result output by the classifier; The training process of the random forest classifier based on Dirichlet allocation includes: Set the number of random forest trees and the maximum depth of each tree, and initialize the hyperparameters of the Dirichlet distribution; Randomly sample the training data to ensure that the input data of each decision tree is not exactly the same; For each decision tree, randomly select some features from all features to increase the differences between trees; Using the selected features and sampled data, a decision tree based on Dirichlet allocation is constructed; at each node of the decision tree, the optimal feature is selected for splitting by considering the parameters of Dirichlet distribution; Build multiple decision trees and integrate the outputs of all trees into the final classification result; The final classification result is verified using the verification set to obtain a verification result, and the classifier is adjusted based on the verification result until the second termination condition is met and the training is completed.

5. The method for sentiment analysis of user comments according to claim 2, characterized in that: The obtaining of the user social relationship vector according to the social relationship network between the users includes: Based on the social relationship network, the user social relationship vector set is obtained by adopting the node2vec algorithm and the Skip-gram model training; Generate and train a node sequence based on the user social relationship vector set to obtain the user social relationship vector; The user social relationship vector is used to represent the user's personalized information, position in the social network, and the degree of association with other users.

6. The method for sentiment analysis of user comments according to claim 2 or 5, characterized in that: The obtaining of a user feature vector according to the user attributes includes: Obtaining an attribute vector according to the user attributes; Get the historical comment vector based on the user's historical comments; The user feature vector is obtained according to the attribute vector and the historical comment vector.

7. A sentiment analysis device for user comments, characterized in that: include: A data acquisition module, used to respectively acquire user comments, user attributes and social relationships between users to be analyzed; A feature vector module, used to obtain a comprehensive feature vector according to the user comments to be analyzed, the user attributes and the social relationship network between the users; A feature extraction module, used for inputting the comprehensive feature vector into an adaptive phase adjustment neural network for feature extraction, and obtaining a target feature output by the neural network; the adaptive phase adjustment neural network is trained by adopting a parameter dynamic phase adjustment method; The emotion classification module is used to input the target feature into a classifier for classification, and obtain a classification result output by the classifier; wherein the classification result includes different categories, and each category represents a different user emotion.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the sentiment analysis method of user comments as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for sentiment analysis of user comments as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for sentiment analysis of user comments as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Automobile brand recommendation method and system based on attention mechanism and LSTM

    CN120235672A

  • Automobile brand recommendation method and system based on attention mechanism and LSTM

    CN120235672B