E-commerce platform user comment emotion tendency analysis method

By constructing a hierarchical semantic graph and a timing syntax graph, and combining the graph neural network to process e-commerce platform comments, the problem of insufficient modeling of multi-level semantics and timing features is solved, and more efficient prediction of emotional tendency is achieved.

CN120373294APending Publication Date: 2025-07-25ANHUI UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510446769.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively model the multi-level semantic and timing characteristics in e-commerce platform comments, and ignore the impact of comment time on emotional tendencies, resulting in insufficient accuracy of sentiment analysis.

Method used

The hierarchical semantic graph and timing syntax graph are constructed, and the graph neural network is used to fuse multi-level semantic information of documents, sentences, aspects and words, and the dependency edge weight of the syntax graph is adjusted through the time attenuation function, and feature extraction and fusion are performed by combining the timing graph neural network and the graph attention network.

Benefits of technology

It improves the accuracy and robustness of sentiment analysis, can capture multi-level semantic and timing changes in comments more accurately, and improves the accuracy of emotional tendency prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120373294A_ABST
    Figure CN120373294A_ABST
Patent Text Reader

Abstract

The invention discloses an e-commerce platform user comment emotion tendency analysis method. The method comprises the following steps: S1, obtaining a comment corpus and preprocessing the comment corpus; s2, constructing a time sequence syntactic graph based on a time decay function weighting dependency edge, and constructing a document-sentence-aspect-word multi-level hierarchical semantic graph based on semantic role labeling; and S3, based on the time sequence graph neural network and the graph attention network, respectively encoding the time sequence syntactic graph and the hierarchical semantic graph, and outputting a corresponding feature matrix. S4, performing dynamic weighted fusion on the two types of features through an attention mechanism to form comprehensive feature representation; s5, inputting the comprehensive features into a full connection layer for emotion classification to obtain emotion polarity; according to the e-commerce platform user comment emotional tendency analysis method provided by the invention, the time sequence syntactic graph and the hierarchical semantic graph are respectively coded through the graph neural network, so that the problems of high semantic information extraction difficulty and context dependency deficiency under the condition of a complex text structure are solved, and support is provided for e-commerce product popularity analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and specifically relates to a method for text sentiment analysis, especially a method for analyzing the sentiment tendency of user comments on an e-commerce platform, which is applicable to scenarios such as comment analysis on e-commerce online shopping platforms. Background Art

[0002] With the explosive growth of user comment data on online shopping platforms, how to extract fine-grained sentiment information from a large number of comments has become a technical difficulty. Existing review texts usually contain descriptions of specific aspects such as product price, quality, and after-sales service, and their semantic expressions have hierarchies (such as word, phrase, and sentence-level semantics) and temporal dynamics (such as changes in sentiment tendency caused by seasonal promotions). However, traditional automated analysis methods are difficult to effectively model such complex semantic and temporal features.

[0003] Existing sentiment analysis methods are mainly divided into two categories: traditional machine learning and deep learning. Traditional machine learning methods mainly use the bag-of-words model combined with classifiers such as SVM. Although they have advantages in interpretability, they are difficult to capture context dependencies and deep semantic associations in the text. In recent years, sentiment analysis methods based on deep learning have made significant progress. In particular, the introduction of graph neural networks (GNNs) can effectively analyze complex syntactic phenomena such as non-continuous modification and turning relationships in the text. However, current research mainly focuses on syntactic dependency graph modeling. Although it can effectively capture the syntactic relationships and dependency structures between words and improve the accuracy of text understanding, it lacks hierarchical fusion of multi-level semantics of document-sentence-aspect-word in review texts, resulting in difficulty in extracting semantic information in the case of complex text structures. In addition, as an important factor affecting sentiment expression (such as a decrease in negative reviews after product iteration), the review time is not fully used in graph neural networks to dynamically adjust the dependency edge weights of the syntactic tree, resulting in the neglect of changes in sentiment tendency in time-sensitive events.

[0004] Aiming at the above deficiencies, the present invention proposes a method for analyzing the sentiment tendency of user comments on an e-commerce platform. By constructing a hierarchical semantic graph, the present invention effectively fuses the semantics of multi-level nodes of documents, sentences, aspects, and words, and enhances the cross-level semantic association ability; proposes to use a time decay function to dynamically adjust the dependency edge weights of the syntactic graph to construct a temporal syntactic graph, quantifying the timeliness of syntactic dependency relationships, and more accurately capturing the temporal evolution characteristics of syntax; based on the temporal graph neural network and the graph attention network, encoding the temporal syntactic graph and the hierarchical semantic graph respectively, outputting corresponding feature matrices, and through dynamic interaction calculation of the feature matrices, fully fusing hierarchical semantic features and temporal syntactic features. Summary of the Invention

[0005] The objective of the present invention is to provide a method for analyzing the sentiment tendency of user comments on an e-commerce platform. This method proposes to construct a hierarchical semantic graph based on hierarchical semantic information, and at the same time, add the comment time information as a node attribute to the syntactic dependency graph to construct a temporal syntactic graph. Then, use a graph neural network to analyze both of them and output the sentiment polarity, so as to improve the accuracy of predicting the sentiment tendency of online shopping comments.

[0006] To achieve the above objective, a method for analyzing the sentiment tendency of user comments on an e-commerce platform provided by the present invention adopts the following steps:

[0007] Step 1: Obtain the comment corpus of the online shopping platform and perform text preprocessing. Segment the comment text into words and sub-word units to ensure capturing rich semantic information. Clean the meaningless characters and non-linguistic information in the comments, remove the content without substantial semantics such as stop words, etc., to provide cleaner input data for subsequent modeling. Use the word vector model (GloVe) to fine-tune the tokenization results to generate high-dimensional vector representations, adapt to the domain characteristics of the comment corpus, and provide semantic embeddings.

[0008] Step 2: Construct a temporal syntactic graph and a hierarchical semantic graph, specifically including:

[0009] Step 2.1: Construct a syntactic dependency graph, where the nodes represent the words in the text and the edges represent the grammatical dependency relationships between the words. Extract the timestamp (comment date) from the comment text and add it as a node attribute to the syntactic dependency graph to construct a temporal syntactic graph. The introduction of the timestamp can help the model capture the characteristics of the temporal changes in the comments.

[0010] Step 2.2: Construct a hierarchical semantic graph based on semantic role labeling. The nodes include a four-level structure of document, sentence, aspect, and word, and the edges represent cross-layer semantic associations (such as sentence-aspect membership relationship, aspect-word modification relationship).

[0011] Step 3: Use a temporal graph neural network (T-GCN) to process the temporal syntactic graph, and at the same time, use a graph attention network to process the hierarchical semantic graph. The steps include:

[0012] Step 3.1: Use a temporal graph neural network (T-GCN) to perform a convolution operation on the temporal syntactic graph to capture the node representations of temporal changes, extract the time-related syntactic relationship representations, and obtain the feature matrix F SDG 。

[0013] Step 3.2: Use a graph attention network (GAT) to model the hierarchical semantic graph, dynamically calculate the similarity between the nodes in the hierarchical semantic graph, and the information of each node is aggregated by the weighted features of its neighbor nodes. The attention weights determine the contribution of the neighbor nodes to the target node, automatically adjust the information propagation path, and focus on capturing the semantic relationships between important nodes to obtain the feature matrix F HG。

[0014] Step 4: Use the attention mechanism to calculate the weights of the temporal syntactic graph feature matrix and the hierarchical semantic graph feature matrix, perform weighted fusion, and splice them to form a comprehensive feature representation. The specific steps are as follows:

[0015] Step 4.1: Apply the attention mechanism to the temporal syntactic graph feature matrix F SDG and the hierarchical semantic graph feature matrix F HG to calculate their respective weight coefficients, and obtain the weight coefficients α SDG and α HG 。

[0016] Step 4.2: Apply different contribution degree weight coefficients to the feature matrix of the temporal syntactic graph and the feature matrix of the hierarchical semantic graph for weighted summation to obtain the fused feature matrix F fuse 。

[0017] Step 4.3: Splice F fuse 、F SDG and F HG to form the final comprehensive feature representation F cat 。

[0018] Step 5: Input the comprehensive feature matrix into the fully connected layer for sentiment classification and output the sentiment polarity.

[0019] Step 5.1: Dimensionality reduction of the fully connected layer: Input the comprehensive feature F cat into the fully connected layer for dimensionality reduction processing, then compress the feature dimension, retain the effective information, and enhance the classification performance of the model.

[0020] Use the softmax algorithm to calculate the probability distribution of sentiment classification (positive, negative, neutral), and determine and output the final sentiment polarity category according to the maximum probability value: positive, negative or neutral.

[0021] Compared with the prior art, the present invention has the following advantages: First, by modeling the comment time evolution characteristics through the temporal syntactic graph, the problem of insufficient capture of temporal dynamics by traditional methods is solved. A hierarchical semantic graph is constructed to integrate multi-level semantic information of documents, sentences, aspects, and words. And through the graph attention network (GAT), the information propagation weight is dynamically adjusted, overcoming the limitation of single-level modeling in the prior art, realizing multi-granularity semantic fusion. The attention mechanism is designed to fuse the features of the temporal syntactic graph and the hierarchical semantic graph, fully mining the complementary information between the two, and solving the problem of insufficient information fusion in the prior art, thereby improving the accuracy and robustness of sentiment analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic flowchart of a method for analyzing the sentiment tendency of user comments on an e-commerce platform proposed by the present invention.

[0023] Figure 2 This is the structural framework diagram of the online shopping review sentiment analysis method proposed by the present invention.

[0024] Figure 3 This is the schematic flow diagram for constructing the temporal syntactic graph.

[0025] Figure 4 This is the schematic flow diagram for constructing the hierarchical semantic graph. Specific implementation manner:

[0026] The following further explains the present invention in combination with the accompanying drawings and specific implementation steps. As Figure 1 , 2 shown, the overall process of the present invention includes the following steps.

[0027] Step 1: Obtain the online shopping platform review corpus, and each review contains information such as text content and timestamp.

[0028] Step 1.1: Preprocess the obtained review corpus: Remove special symbols, non-verbal characters, and words with no substantial semantic meaning, and segment the review text into word and sub-word units.

[0029] Step 1.2: Use the pre-trained word vector model GloVe to convert each word and sub-word into a 300-dimensional vector representation.

[0030] Step 2: Construct the temporal syntactic graph and the hierarchical semantic graph, convert the obtained text data into graph-structured data, and the combination Figure 3 , 4 is described as follows:

[0031] Step 2.1: First, construct the temporal syntactic graph, use the spaCy tool for syntactic parsing, input the sentence to be parsed, output the dependency relationship, the nodes represent each word, and the edges represent the type of dependency relationship. Extract the timestamp of the review and calculate the time decay weight:

[0032]

[0033] where w ij is the time decay weight, Δt = current time - review time (unit: days), and α is the decay coefficient. Multiply the original weight of the dependency edge by the time decay weight to generate the adjacency matrix A with temporal information and the node feature matrix X.

[0034] Step 2.2: Construct a hierarchical semantic graph with nodes at four different levels: document, sentence, aspect, and word. The document node represents each comment, the sentence node represents the independent unit after the comment is segmented by full stops or exclamation marks, the aspect node is the product attribute extracted based on semantic role annotation, and the word node is the smallest semantic unit after word segmentation.

[0036] The cross-layer connection rules for edges are as follows: If a sentence belongs to the document, an edge is added between them; if the sentence contains an aspect word, an edge is added between them (weight = TF-IDF value), where TF-IDF is used to measure the importance of a term in a document collection; if a word modifies the aspect, an edge is added (weight = pointwise mutual information PMI), and pointwise mutual information (PMI) is an index used to measure the statistical correlation between two events. The in-layer connection principle is as follows: Calculate the cosine similarity between word nodes (based on the fine-tuned word vectors), and add an edge according to the similarity magnitude.

[0037] Step 3: Dual-channel graph feature extraction: Use a temporal graph neural network to process the temporal syntactic graph to extract temporal syntactic features, and use a hierarchical graph attention network to process the hierarchical semantic graph to extract hierarchical semantic features, and output the corresponding feature matrices. The specific steps are as follows:

[0038] Step 3.1: Extract temporal syntactic features: Input the adjacency matrix A and node feature matrix X of the temporal syntactic graph into the temporal graph neural network, and use the graph convolution formula:

[0039]

[0040] where, where A is the original adjacency matrix, I is the identity matrix, is the degree matrix with self-loops, where, i, j represent the rows and columns of the matrix, represents the degree of node i, that is, the sum of the connections of node i to all neighbor nodes (including itself), and W (l) is a learnable parameter, and σ is the ReLu activation function. Output the temporal syntactic feature matrix F SDG .

[0041] Step 3.2: Extract hierarchical semantic features: First, calculate the in-layer attention. For node i and its neighbor node j, calculate the attention coefficient e:

[0042] e ij = LeakyReLU(a T [Wh i || Wh j )

[0043] where, W is the shared weight matrix, and a is the attention vector.

[0044] Re-normalize attention weights:

[0045]

[0046] Then perform cross-layer feature aggregation: Aggregate the features of the document, sentence, aspect, and word layers respectively, sum them up layer by layer with weights, and output the hierarchical semantic feature matrix F HG 。

[0047] Step 4: Use the multi-head attention mechanism to calculate the weights of the temporal syntactic graph feature matrix and the hierarchical semantic graph feature matrix, perform weighted fusion, and splice them to form a comprehensive feature representation. The main steps are as follows:

[0048] Step 4.1: First calculate score(F SDG ) and score(F HG ), which are calculated by the following formulas:

[0049] score(F SDG ) = W1F SDG + b1

[0050] score(F HG ) = W2F HG + b2

[0051] Among them, W1 and W2 are the weight matrices associated with F SDG and F HG respectively, and b1 and b2 are the corresponding bias terms.

[0052] Step 4.2: Then calculate the contribution weight coefficients of the temporal syntactic graph and the hierarchical semantic graph, which are α SDG and α HG respectively, and are calculated by the following formulas:

[0053]

[0054]

[0055] Step 4.4: Then obtain the fused feature matrix by weighting according to different contribution weight coefficients. The calculation formula is as follows:

[0056] F fuse = α SDG F SDG + α HG F HG

[0057] Step 4.5: Perform a further splicing operation on the fused feature matrix F fuse after weight adjustment, and splice F SDG and F HG, the three are concatenated into a comprehensive feature representation, and the specific formula is as follows:

[0058] F cat =[F fuse F SDG F HG

[0059] The comprehensive feature representation F cat is used to completely retain the information of the features of different graphs for classification use.

[0060] Step 5: Input F cat into the fully connected layer for feature dimensionality reduction, use the activation function ReLU for non-linear transformation, and apply the Softmax classifier to output the sentiment classification result P=(p pos p neg p neu ), and the specific calculation formula is as follows:

[0061] P = Softmax(W out F cat +b out )

[0062] Among them, W out is the weight matrix of the fully connected layer, b out is the bias term, and p pos , p neg , p neu are the probabilities that the comment belongs to positive, negative, and neutral sentiments respectively.

[0063] The above specific implementation manners are only exemplary illustrations of the technical solutions of the present invention, and do not limit the scope of its protection. Those skilled in the art should understand that without departing from the core idea of the present invention, the technical features can be reasonably adjusted or equivalently replaced, and such modifications and replacements should be covered within the scope of the claims of the present invention.​

Claims

1. A method for analyzing the sentiment tendency of user comments on an e-commerce platform, Its features include the following steps: Step 1: Obtain the review corpus from the online shopping platform and perform text preprocessing, including word segmentation, fine-tuning the GloVe model based on the review corpus, converting each word and sub-word into a high-dimensional vector representation, and removing irrelevant information such as meaningless characters and stop words; Step 2: Construct a temporal syntactic graph and a hierarchical semantic graph, specifically including: Step 2.1: Construct a syntactic dependency graph, where the nodes represent words and the edges represent the grammatical dependency relationships between words, and a temporal syntactic graph is constructed by adding the review timestamp; Step 2.2: Construct a hierarchical semantic graph, where the nodes represent information at the document, sentence, aspect, and word levels, and the edges represent the semantic relationships between the nodes at each level; Step 3: Process the temporal syntactic graph using a temporal graph neural network (T-GCN), and at the same time process the hierarchical semantic graph through a graph attention network (GAT), and the steps include: Step 3.1: Use T-GCN to model the temporal syntactic graph containing temporal information, capture the node representations of temporal changes, and obtain the feature matrix F SDG ; Step 3.2: Use the Graph Attention Network (GAT) to model the hierarchical semantic graph, automatically adjust the information propagation path, extract hierarchical semantic information, and obtain the feature matrix F HG ; Step 4: Use the attention mechanism to calculate the weights of the feature matrices of the temporal syntactic graph and the hierarchical semantic graph, perform weighted fusion, and splice them to form a comprehensive feature representation; Step 5: Input the comprehensive feature matrix into a fully connected layer for sentiment classification and output the sentiment polarity.

2. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 2.1, is characterized in that: When constructing the syntactic dependency graph, time information is added, and the time information is the review timestamp, which is used to represent the time attribute of the review, and a temporal syntactic graph is constructed. The T-GCN is used to capture the feature changes of the time nodes, so as to explore the potential impact of the review time on the sentiment expression.

3. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 2.2, is characterized in that: Construct a hierarchical semantic graph. The nodes of the hierarchical semantic graph include document nodes, sentence nodes, aspect nodes, and word nodes, and the edges between the nodes represent the associations between different hierarchical semantic information; Cross-layer connection principle: If a sentence belongs to the document, an edge is added between them; If the sentence contains an aspect word, an edge is added between them; If a word modifies the aspect, an edge is added. The same-layer connection principle is as follows: Calculate the cosine similarity between word nodes (based on the fine-tuned word vectors), and add edges according to the similarity size.

4. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 3.1, is characterized in that: Introduce a temporal graph neural network (T-GCN) to perform convolutional operations on the temporal syntactic graph containing time information, capture the changes in temporal information, and enhance the model's perception ability of the review time dependence and temporal changes.

5. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 3.2, is characterized in that: The graph attention network (GAT) performs weighted propagation on the information between each level of the hierarchical semantic graph through a dynamic weight allocation mechanism based on multi-head attention, and extracts the relationships and semantic information between different hierarchical semantic information.

6. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 4, is characterized in that: The fused feature matrix is obtained by weighting the feature matrices of the temporal syntactic graph and the hierarchical semantic graph with different contribution weight coefficients. The calculation formula of the fused feature matrix is as follows: F fuse = α SDG F SDG + α HG F HG Among them, F SDG and F HG are the feature matrices from the temporal syntactic graph and the hierarchical semantic graph respectively. α SDG and α HG are the contribution degree weight coefficients of the graph and the hierarchical semantic graph respectively, and are calculated by the following method: Among them, score(F SDG ) and score(F HG ) are scores calculated based on the feature matrices F SDG sum and F HG calculated, and the calculation formula is as follows: score(F SDG ) = W1F SDG + b1 score(F HG ) = W2F HG + b2 Among them, W1 and W2 are weight matrices associated with F SDG and F HG respectively, and b1 and b2 are corresponding bias terms.

7. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 4, is characterized in that: The fused feature matrix F after weight adjustment fuse Perform a further concatenation operation on F fuse , F SDG and F HG , and the three are concatenated into a comprehensive feature representation. The specific formula is as follows: F cat = [F fuse F SDG F HG ​ Comprehensive feature representation F cat Used to completely retain the information of the features of different graphs for classification use.

8. The method for analyzing the emotional tendency of user comments on an e-commerce platform according to claim 1, step 5, is characterized in that: Input F cat into the fully connected layer for feature dimensionality reduction, use the activation function ReLU for non-linear transformation, and apply the Softmax classifier to output the sentiment classification result P=(p pos p neg p neu ). The specific calculation formula is as follows: P = Softmax(W out F cat + b out ) Among them, W out is the weight matrix of the fully connected layer, and b out is the bias term. p pos , p neg , and p neu are the probabilities that the comment belongs to positive, negative, and neutral sentiment respectively.

Citation Information

Cited By

  • Fine-grained customer satisfaction and attention analysis method based on network comments

    CN121456135A