Grape e-commerce comment fine-grained sentiment analysis method and system for progressive transmission of three-dimensional information
By adopting a three-dimensional information progressive transmission method in Grape E-commerce Review, combined with BERT, TripleBi-LSTM and DualChannel-Attention technology, the problem of insufficient accuracy of fine-grained sentiment analysis in the existing technology is solved, and the accuracy of Grape E-commerce Review is achieved. Higher recognition accuracy and sentiment analysis effect.
Patent Information
- Application Number
- CN202411603377.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
In the fine-grained emotional analysis of Chinese grape e-commerce reviews, the prior art is difficult to adapt to the diversity of emotional expression, resulting in insufficient accuracy in extracting aspect and opinion words.
The three-dimensional information progressive transmission method is adopted, and the comment text is vectorized through the BERT model, and the three-dimensional information is initially encoded using the TripleBi-LSTM module, and feature fusion and progressive transmission are carried out in combination with the DualChannel-Attention mechanism. The final decoding is performed using conditional random fields.
It significantly improves the accuracy of recognition of aspects, opinion words and emotional polarity in grape e-commerce comments, and improves the effect and accuracy of fine-grained sentiment analysis.
Smart Images

Figure CN119474388A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of agricultural technology in natural language processing, and in particular relates to a method and system for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information. Background Art
[0002] Fine-grained sentiment analysis is an important task in natural language processing. It goes deep into every detail of the sentence and aims to extract aspect words, sentiment words and corresponding sentiment polarity. In the field of grape reviews in agriculture, this task aims to extract aspect words and opinion word types in the reviews, such as taste, price, appearance, quality, etc., and classify the sentiment of the aspect word types, such as positive, negative and neutral. Through fine-grained sentiment analysis, grape e-commerce and suppliers can understand consumers' real feedback and needs for products more finely, so as to optimize product quality and services in a targeted manner. At the same time, this task also helps e-commerce platforms provide consumers with more personalized and accurate shopping recommendations and enhance users' shopping experience.
[0003] Traditional methods for sentiment analysis tasks can be divided into pipeline-based, joint-based, and unified-based methods. Although these methods can achieve good results, they have obvious deficiencies in the extraction accuracy of aspect words and opinion words in the fine-grained sentiment analysis task of Chinese grape e-commerce reviews. Pipeline methods usually decompose the sentiment analysis task into multiple independent subtasks, such as aspect word extraction, opinion word identification, and sentiment polarity judgment. However, this method often ignores the intrinsic connection and dependency between subtasks when processing Chinese grape e-commerce reviews. Due to the complexity of the Chinese language and the diversity of grape e-commerce reviews, pipeline methods may introduce errors in each stage, and these errors will be amplified in subsequent stages, resulting in a decrease in the final extraction accuracy. Joint methods attempt to improve performance by optimizing multiple subtasks simultaneously. However, in the fine-grained sentiment analysis of Chinese grape e-commerce reviews, joint methods may face challenges in feature sharing and model complexity. Different subtasks may require different feature representations and model structures, and simply sharing features or adopting a unified model may not fully capture the uniqueness of each task, thereby affecting the extraction accuracy of aspect words and opinion words. Unified methods aim to solve all subtasks through a single model. Although this approach has certain advantages in simplifying the model and reducing error propagation, its generalization ability and flexibility may be limited when dealing with complex Chinese grape e-commerce reviews. Due to the richness of the Chinese language and the diversity of sentiment expressions in reviews, a unified approach may be difficult to adapt to all situations, resulting in insufficient accuracy in extracting words and opinion words in this regard.
[0004] Through the above analysis, the problems and defects of the prior art are as follows:
[0005] Due to the richness of the Chinese language and the diversity of sentiment expressions in comments, existing methods may find it difficult to adapt to all situations, resulting in insufficient accuracy in extracting sentiment words and opinion words. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information.
[0007] The present invention is implemented as follows: a fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information, comprising:
[0008] Step 1: Build a grape e-commerce review text dataset;
[0009] Step 2: vectorization of grape e-commerce review text;
[0010] Use the vector representation technology BERT (Bidirectional Encoder Representations from Transformers) to convert each character in the comment text in the grape e-commerce comment text dataset constructed in step 1 into a character vector;
[0011] The BERT (Bidirectional Encoder Representations from Transformers) is a bidirectional encoding representation technology based on transformer, which is a deep learning model architecture for natural language processing and sequence-to-sequence tasks;
[0012] Step 3: Perform preliminary vector encoding of the three-dimensional information through the FirTripleBi-LSTM of the TripleBi-LSTM module:
[0013] For the grape e-commerce review text in the grape e-commerce review data set vectorized in step 2, the three-dimensional information is preliminarily vectorized by the FirTripleBi-LSTM module to obtain feature encoding vectors of the three dimensions respectively; the three dimensions in the grape e-commerce review text data include aspect word dimension, opinion word dimension and sentiment polarity dimension;
[0014] The TripleBi-LSTM module is a fine-grained three-dimensional feature processing network module designed by the present invention for fine-grained sentiment analysis of grape e-commerce reviews;
[0015] The FirTripleBi-LSTM network is the first layer network in the TripleBi-LSTM module;
[0016] The calculation process of the FirTripleBi-LSTM module for preliminary vectorization of the Grape e-commerce review text is as follows:
[0017]
[0018] Character x t represents the character encoding vector at time step t, and are the vector representations of the previous step and the next step respectively, Represents the character encoding vector representation obtained by cascading forward and backward;
[0019] Step 4: Use the DualChannel-Attention mechanism to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM:
[0020] The DualChannel-Attention described above combines self-Attention and Agent-Attention, applies the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performs global and local feature fusion on the feature encoding vector through the dual-channel attention mechanism.
[0021] The self-Attention and Agent-Attention are the self-attention mechanism and the agent attention mechanism respectively;
[0022] The feature encoding vectors H and E obtained in step 3 and step 2 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows:
[0023] v 1 =H[:halflen]
[0024] v 2 =H[halflen:]
[0025] k 1 ,q 1 =E[:halflen]
[0026] k 2 ,q 2 =E[halflen:]
[0027] E up =AgentAttention(v 1 ,k 1 ,q 1 )
[0028] E low =selfAttention(v 2 ,k 2 ,q 2 )
[0029] E A =DualChannelAttention(E up +E low )
[0030] Where:
[0031] H represents the encoded feature vector of three-dimensional information obtained by the FirTripleBi-LSTM module;
[0032] E represents the original encoding vector output by BERT;
[0033] v 1 , k 1 ,q 1 They are the first layer representation vector of the input sentence X and the first half of the BERT representation vector;
[0034] v 2 , k 2 ,q 2 It is the second layer representation vector of the input sentence X and the second half of the BERT representation vector;
[0035] halflen means half the length of a vector;
[0036] E up is the output of the AgentAttention module;
[0037] E low is the output of the selfAttention module;
[0038] AgentAttention(.) represents a linear attention module;
[0039] selfAttention(.) represents the self-attention module;
[0040] DualChannelAttention(.) represents the dual-channel attention module;
[0041] The DualChannel-Attention module is a Dual Channel Attention Mechanism, that is, a dual-channel attention mechanism.
[0042] Step 5: Use the SecTripleBi-LSTM network through the TripleBi-LSTM module to re-encode the Grape e-commerce review text feature vector:
[0043] The progressively enhanced dimensional feature fusion vector E obtained in step 4 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by FirTripleBi-LSTM is used as the input of the SecTripleBi-LSTM module. The deeper context feature information in the grape e-commerce review text is learned from the feature enhancement vector M through SecTripleBi-LSTM to obtain the feature representation vector K.
[0044] M=E A +H
[0045] K=SecTripleBi-LSTM(M)
[0046] The SecTripleBi-LSTM network is the second layer network structure in the TripleBi-LSTM module;
[0047] Step 6: Use the conditional random field to decode the feature vector K and obtain the final output sequence Y* of the input sentence X.
[0048] Further, the specific process of step 1 is as follows: collect grape e-commerce review text data information from the e-commerce platform to initially obtain data set 1; obtain data set 2 by removing duplicates and punctuation marks from data set 1, and use BIO tags to annotate aspect words in data set 2, use BO, IO and O to annotate opinion words, use PMN to annotate sentiment polarity, and annotate word categories after BIO at the same time; finally obtain the grape e-commerce review text data set GrapeEcommerce;
[0049] In the BIO tag, B represents the beginning of a word, I represents the rest of the word, and O represents other words;
[0050] In the PMN notation, P represents positive emotion, M represents moderate emotion, and N represents negative emotion.
[0051] The categories include the taste, quality, price, cost-effectiveness, packaging, weight, appearance, service, size and logistics of the grapes.
[0052] Furthermore, the specific process of step 2 is: using vector representation technology to convert each character in the grape e-commerce review text in the grape e-commerce review text dataset constructed in step 1 into a character vector;
[0053] The specific process of step 2 is: the character sequence X of the input grape e-commerce review text is converted into {x1, x2, x3, ..., x n} is converted to the corresponding character vector sequence E = {e1, e2, e3, ..., e n}, provide input for the upper network;
[0054] Where X represents a character sequence;
[0055] x represents a character;
[0056] e represents a character vector;
[0057] n means the nth in the sequence.
[0058] Further, the specific process of step 3 is as follows: for the grape e-commerce review text in the grape e-commerce review data set vectorized in step 2, the three-dimensional information is preliminarily vectorized through the FirTripleBi-LSTM network of the TripleBi-LSTM module to obtain the feature coding vectors H of the three dimensions respectively. a , H o , H s ; a, o, s correspond to the three dimensions of aspect, opinion and sentiment respectively;
[0059] The three dimensions of aspect, opinion and sentiment in the grape e-commerce review text data are aspect word dimension, opinion word dimension and sentiment polarity dimension respectively;
[0060] Furthermore, the specific process of step 4 is: using the DualChannel-Attention mechanism to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM:
[0061] The DualChannel-Attention described above combines self-Attention and Agent-Attention, applies the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performs feature fusion on the feature encoding vector through the dual-channel attention mechanism.
[0062] The feature encoding vectors H and E obtained in step 3 and step 2 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows:
[0063] v 1 =H[:halflen]
[0064] v 2 =H[halflen:]
[0065] k 1 ,q 1 =E[:halflen]
[0066] k 2 ,q 2 =E[halflen:]
[0067] E up =AgentAttention(v 1 ,k 1 ,q 1 )
[0068] E low =selfAttention(v 2 ,k 2 ,q 2 )
[0069] E A =DualChannelAttention(E up +E low )
[0070] Where:
[0071] H represents the encoded feature vector of three-dimensional information obtained by the FirTripleBi-LSTM module;
[0072] E represents the original encoding vector output by BERT;
[0073] v 1 , k 1 ,q 1 They are the first layer representation vector of the input sentence X and the first half of the BERT representation vector;
[0074] v 2 , k 2 ,q 2It is the second layer representation vector of the input sentence X and the second half of the BERT representation vector;
[0075] halflen means half the length of a vector;
[0076] E up is the output of the AgentAttention module;
[0077] E low is the output of the selfAttention module;
[0078] AgentAttention(.) represents a linear attention module;
[0079] selfAttention(.) represents the self-attention module;
[0080] DualChannelAttention(.) represents the dual-channel attention module;
[0081] The DualChannel-Attention module is a Dual Channel Attention Mechanism, that is, a dual-channel attention mechanism.
[0082] The specific process of step 5 is: fusion vector E obtained by step 4 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by the FirTripleBi-LSTM network of the TripleBi-LSTM module is used as the input of the SecTripleBi-LSTM network in the TripleBi-LSTM module. The deeper context feature information in the grape e-commerce review text is learned from the feature enhancement vector M through the SecTripleBi-LSTM to obtain the feature representation vector K.
[0083] M=E A +H
[0084] K = SecTripleBi-LSTM(M).
[0085] Furthermore, the specific process of step 6 is: based on the sentence feature vector K={k1, k2, k3, ..., kn} obtained in step 5, the conditional probability of the possible output label sequence Y is calculated as follows:
[0086]
[0087] S(K,Y)=∑ i,k λ k t k (yi-1 ,y i ,h,i)+∑ i,l μ l s l (y i ,h,i)
[0088] Where:
[0089] P(Y / K) represents the conditional probability of the output label sequence Y;
[0090] S(Y / K) represents the feature vector of a given sentence;
[0091] X represents the input feature vector;
[0092] Y represents the output label sequence;
[0093] Y X Represents all possible output label sequences of the input feature vector X;
[0094] K represents the sentence feature vector;
[0095] i represents the i-th index position in the sequence;
[0096] k represents the kth index sorting of the state characteristic function;
[0097] h represents the vector at position i in the sentence feature vector K;
[0098] y i Represents the label or state of a given index position i in the sequence;
[0099] t k represents the state characteristic function;
[0100] sl represents the transfer characteristic function;
[0101] λ k Represents the state characteristic function t k The weight of
[0102] μ l Denotes the transfer characteristic function s l The weight of
[0103] Finally, the output label sequence Y* with the largest conditional probability is used as the input feature vector X and the final output sequence:
[0104] Y * =argmaxP(Y / K).
[0105] Another object of the present invention is to provide a fine-grained sentiment analysis system for grape e-commerce reviews with progressive transmission of three-dimensional information, comprising:
[0106] Construction module, used to construct grape e-commerce review text dataset;
[0107] The vectorization module is used for the vectorization of grape e-commerce review text. The vector representation technology BERT is used to convert each character in the review text in the constructed grape e-commerce review text dataset into a character vector.
[0108] The vector encoding module is used to perform preliminary vector encoding of three-dimensional information through the FirTripleBi-LSTM of the TripleBi-LSTM module:
[0109] The fusion module is used to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM using the DualChannel-Attention mechanism:
[0110] The encoding module is used to re-encode the text feature vector of the grape e-commerce review using the SecTripleBi-LSTM network through the TripleBi-LSTM module:
[0111] The decoding module is used to decode the feature vector K using the conditional random field to obtain the final output sequence Y* of the input sentence X.
[0112] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information.
[0113] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the method for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information.
[0114] Another object of the present invention is to provide an information data processing terminal, which is used to implement the grape e-commerce review fine-grained sentiment analysis system with progressive transmission of three-dimensional information.
[0115] In combination with the above technical solutions and the technical problems solved, please analyze the advantages and positive effects of the technical solutions to be protected by the present invention from the following aspects:
[0116] First, the dual-channel attention mechanism is introduced into the model to fuse the feature information between the three sub-task modules, thereby extracting the aspect words that exist or are implicit in the comments, and improving the classification accuracy of opinion word extraction and sentiment polarity. This is the research innovation of this patent. Combined with the dual-channel attention mechanism, the aspect word and opinion word information are effectively integrated into the opinion word extraction and sentiment classification modules, which plays an important role in promoting the accuracy of each module.
[0117] (I) Based on the three dimensional information of aspect words, opinion words and sentiment polarity in fine-grained sentiment analysis, the present invention constructs a fine-grained sentiment analysis method for grape e-commerce reviews with three-dimensional information progressive transmission. The method creatively designs two modules, TripleBi-LSTM and DualChannel-Attention, and effectively improves the recognition accuracy of aspect words, opinion words and sentiment polarity by using the transmission of three-dimensional progressive information, and achieves the best effect on the self-built dataset.
[0118] (II) The DualChannel-Attention module of the present invention focuses on extracting global features and local features from the grape e-commerce review text, further improving the feature extraction capability of three-dimensional information, obtaining an enhanced feature representation vector, and optimizing the information feature representation, thereby achieving the effect of improving the recognition accuracy of fine-grained words.
[0119] (III) The DualChannel-Attention module of the present invention aims at the current situation that aspect words are missing, opinion words are difficult to identify, and sentiment polarity is difficult to classify. By fusing AgentAttention and selfAttention, the global and local feature information of the feature vector are extracted respectively, and the feature information of the three dimensions of the Grape E-commerce review text is progressively transferred and feature extraction and fusion are performed, which significantly improves the model's recognition ability for the three dimensions in the Grape E-commerce review text. The attention combination method adopted by the present invention enables the vector feature representation to contain more comprehensive feature information, and then allows this module to effectively consider the contextual information between the three dimensions, so that the missing aspect words can be extracted and the opinion words with various expressions can be identified, and the sentiment polarity can be correctly classified at the same time.
[0120] (IV) Based on Bi-LSTM, the TripleBi-LSTM network of the present invention designs two layers of three parallel long short-term memory networks to process aspect word information, opinion word information and sentiment polarity information respectively. By processing the context feature information of each dimension separately, focusing on the recognition and extraction of a fine-grained element respectively, and progressively transmitting the three-dimensional information of the sentiment element in the TripleBi-LSTM network, the learning ability of the model and the recognition accuracy of the fine-grained elements are further improved.
[0121] (V) In the present invention, the combination of TripleBi-LSTM and DualChannel-Attention enables the information between the three dimensions of fine-grained elements to be transmitted progressively and fused interactively, which is more suitable for dealing with the problems of missing aspect words, opinion word recognition, and poor sentiment classification in the review text of Grape E-commerce.
[0122] (VI) Compared with existing methods, the present invention can not only improve the recognition effect of each fine-grained element, but also has a certain degree of generalization in other fine-grained sentiment analysis in agriculture. In terms of application, the present invention can help relevant practitioners identify corresponding fine-grained sentiments from massive comment texts, help e-commerce and suppliers quickly obtain real user feedback and needs, and thus optimize product quality and services in a targeted manner; at the same time, it can also help e-commerce platforms provide consumers with more personalized and accurate shopping recommendations, and improve user shopping experience.
[0123] Second, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:
[0124] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:
[0125] The fine-grained sentiment analysis method of grape e-commerce comments with three-dimensional information progressive transmission of the present invention uses deep learning technology to significantly improve the recognition accuracy of aspect words, opinion words and sentiment polarity in the comment text. The implementation of this technical solution not only helps e-commerce companies to quickly and accurately obtain user feedback, but also can deeply explore the specific needs and preferences of consumers, thereby providing a strong basis for product improvement and service improvement. By accurately analyzing the emotional tendency of user comments, companies can timely identify user satisfaction and dissatisfaction, thereby optimizing product quality and service experience, thereby reducing customer churn and improving customer loyalty. In addition, the technology can also provide more accurate personalized recommendation services for e-commerce platforms, helping users find products that meet their emotional needs, thereby effectively improving purchase conversion rates and promoting sales growth. In summary, the present invention not only has significant technical advantages, but also creates huge commercial potential for e-commerce companies, can enhance user stickiness and enhance brand influence in a highly competitive market, thereby achieving sustainable development, and has huge commercial potential.
[0126] (2) The technical solution of the present invention solves the technical difficulties in applying fine-grained sentiment analysis of grape e-commerce reviews:
[0127] The technical solution of the present invention effectively solves the technical problems existing in the field of sentiment analysis of grape e-commerce reviews, including the lack of aspect words, difficulty in identifying opinion words, and inaccurate classification of sentiment polarity. These problems limit the application effect of fine-grained sentiment analysis. In view of this situation, the present invention innovatively designs a dual-channel attention mechanism and a TripleBi-LSTM network module, which significantly improves the efficiency and accuracy of the model in processing these fine-grained elements by fully integrating global and local features. This solution not only improves the performance of sentiment analysis of grape e-commerce reviews and meets the industry's urgent need for fine-grained sentiment analysis, but also provides new directions and ideas for technological progress in related e-commerce review fields, showing good application prospects.
[0128] (3) The technical solution of the present invention overcomes technical prejudice:
[0129] The technical solution of the present invention effectively overcomes the technical bias existing in traditional sentiment analysis models. By designing a dual-channel attention mechanism and a TripleBi-LSTM network, the contextual information in the text can be fully considered, avoiding the one-sided focus on specific emotions or aspect words in the previous feature extraction process. This method enables the model to analyze from multiple dimensions when understanding and identifying complex emotions in comments, thereby improving the overall analysis accuracy. Compared with the limitations of traditional methods, the mechanism adopted by the present invention ensures the comprehensiveness and accuracy of information, making the model more robust and flexible when dealing with diverse emotional expressions, and significantly improving the effect of fine-grained sentiment analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0130] Figure 1 It is a flow chart of a fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information provided by an embodiment of the present invention.
[0131] Figure 2 It is a structural block diagram of a fine-grained sentiment analysis system for grape e-commerce reviews with progressive transmission of three-dimensional information provided by an embodiment of the present invention.
[0132] Figure 3 It is a structural schematic diagram of a fine-grained sentiment analysis method for grape e-commerce reviews provided by an embodiment of the present invention.
[0133] Figure 4 It is a schematic diagram of the dual-channel attention mechanism structure provided by an embodiment of the present invention.
[0134] Figure 5 It is a schematic diagram for comparing experimental accuracy results on fine-grained elements provided by an embodiment of the present invention.
[0135] Figure 6 It is a schematic diagram comparing the overall model performance effects on fine-grained elements provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0136] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0137] like Figure 1 As shown, a method for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information provided by an embodiment of the present invention includes the following steps:
[0138] S101, build a grape e-commerce review text dataset;
[0139] S102, Grape e-commerce review text vectorization;
[0140] Use the vector representation technology BERT to convert each character in the comment text in the grape e-commerce comment text dataset constructed in step 1 into a character vector;
[0141] S103, preliminary vector encoding of the three-dimensional information is performed through the FirTripleBi-LSTM of the TripleBi-LSTM module:
[0142] The grape e-commerce review text in the grape e-commerce review data set vectorized by S102 is preliminarily vectorized by the FirTripleBi-LSTM module to obtain feature encoding vectors of the three dimensions respectively; the three dimensions in the grape e-commerce review text data include aspect word dimension, opinion word dimension and sentiment polarity dimension;
[0143] The fine-grained sentiment analysis method of grape e-commerce reviews with progressive transmission of three-dimensional information provided by the embodiment of the present invention performs refined sentiment analysis on grape e-commerce reviews through multiple steps. The specific working principle is as follows:
[0144] First, in step S101 (building a grape e-commerce review text dataset), the system collected and organized grape product review data on e-commerce platforms. To ensure the breadth and representativeness of the dataset, the system captured user reviews of grape products from multiple e-commerce platforms, including review texts of different varieties, origins, and sales channels. The data was then preprocessed, including removing irrelevant characters, standardizing punctuation, and removing duplicate reviews, to ensure the integrity and consistency of the review data, laying the foundation for subsequent sentiment analysis.
[0145] In step S102 (vectorization of Grape e-commerce comment text), the system uses the BERT model to vectorize the preprocessed comment text and convert the characters in each comment into character vectors. BERT can capture the contextual semantic information of the characters in the comment. This bidirectional encoding method ensures that each character contains contextual relationships, which not only reflects the emotional tendency of the comment, but also maintains the fine-grained information in the text. Through the vectorization operation, the system converts natural language into a numerical representation to facilitate subsequent sentiment calculations.
[0146] In step S103 (preliminary vector encoding through TripleBi-LSTM module), the system uses TripleBi-LSTM module to perform preliminary vector encoding on the three-dimensional information of the comment text. The FirTripleBi-LSTM submodule in TripleBi-LSTM first encodes the character-level information, extracts the emotional information of the characters, and generates a preliminary character vector. Then, the module encodes the information of the three dimensions step by step, and the encoding results of each level are progressively passed to the next layer, so that the final generated emotional vector contains information in three dimensions: aspect, opinion, and emotion. Through this layer-by-layer progressive three-dimensional encoding method, the system can accurately capture the fine-grained emotional characteristics of the comments.
[0147] Finally, after all the steps are completed, the system combines the three-dimensional information progressive vector and inputs the initially extracted fine-grained sentiment information into the sentiment analysis model for analysis. In terms of model integration, the sentiment information of the three dimensions of opinion and emotion is further processed to generate the final sentiment score and classification results. For example, the system can judge the user's specific evaluation of the taste, price, packaging and other aspects of grape products based on the extracted sentiment vector, and subdivide it into positive, negative and neutral emotions. This three-dimensional information progressive analysis method improves the accuracy of sentiment analysis, can provide e-commerce platforms with more valuable reference sentiment data, and is conducive to product improvement and precision marketing.
[0148] The calculation process of the FirTripleBi-LSTM module for preliminary vectorization of the Grape e-commerce review text is as follows:
[0149]
[0150] Character x t represents the character encoding vector at time step t, and are the vector representations of the previous step and the next step respectively, Represents the character encoding vector representation obtained by cascading forward and backward;
[0151] S104, using the DualChannel-Attention mechanism to progressively transfer and fuse feature information between the three-dimensional modules in Triple1Bi-LSTM:
[0152] The DualChannel-Attention described above combines self-Attention and Agent-Attention, applies the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performs global and local feature fusion on the feature encoding vector through the dual-channel attention mechanism; Figure 4 shown.
[0153] The feature encoding vectors H and E obtained in S103 and S102 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows:
[0154] v 1 =H[:halflen]
[0155] v 2 =H[halflen:]
[0156] k 1 ,q 1 =E[:halflen]
[0157] k 2 ,q 2 =E[halflen:]
[0158] E up =AgentAttention(v 1 ,k 1 ,q 1 )
[0159] E low =selfAttention(v 2 ,k 2 ,q 2 )
[0160] E A =DualChannelAttention(E up +E low )
[0161] Where:
[0162] H represents the encoded feature vector of three-dimensional information obtained by the FirTripleBi-LSTM module;
[0163] E represents the original encoding vector output by BERT;
[0164] v 1 , k 1 ,q 1 They are the first layer representation vector of the input sentence X and the first half of the BERT representation vector;
[0165] v 2 , k 2 ,q 2 It is the second layer representation vector of the input sentence X and the second half of the BERT representation vector;
[0166] E up is the output of the AgentAttention module;
[0167] E low is the output of the selfAttention module;
[0168] AgentAttention(.) represents a linear attention module;
[0169] selfAttention(.) represents the self-attention module;
[0170] DualChannelAttention(.) represents the dual-channel attention module;
[0171] The DualChannel-Attention module is a Dual Channel Attention Mechanism, that is, a dual-channel attention mechanism.
[0172] S105: Use the SecTripleBi-LSTM network through the TripleBi-LSTM module to re-encode the feature vector of the grape e-commerce review text:
[0173] The progressively enhanced dimensional feature fusion vector E obtained in S104 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by FirTripleBi-LSTM is used as the input of the SecTripleBi-LSTM module. The deeper context feature information in the grape e-commerce review text is learned from the feature enhancement vector M through SecTripleBi-LSTM to obtain the feature representation vector K.
[0174] M=EA +H
[0175] K=SecTripleBi-LSTM(M)
[0176] S106: Use the conditional random field to decode the feature vector K to obtain the final output sequence Y* of the input sentence X.
[0177] The specific process of S101 provided in the embodiment of the present invention is as follows: collecting grape e-commerce review text data information from the e-commerce platform to initially obtain data set 1; removing duplicates and punctuation marks from data set 1 to obtain data set 2, and using BIO tags to mark aspect words in data set 2, using BO, IO and O to mark opinion words, using PMN to mark sentiment polarity, and marking the category of words after BIO at the same time; finally obtaining the grape e-commerce review text data set GrapeEcommerce;
[0178] In the BIO tag, B represents the beginning of a word, I represents the rest of the word, and O represents other words;
[0179] In the PMN notation, P represents positive emotion, M represents moderate emotion, and N represents negative emotion.
[0180] The categories include the taste, quality, price, cost-effectiveness, packaging, weight, appearance, service, size and logistics of the grapes.
[0181] The specific process of S102 provided in the embodiment of the present invention is: using vector representation technology to convert each character in the grape e-commerce review text in the grape e-commerce review text data set constructed in step 1 into a character vector;
[0182] The specific process of S102 is: convert the character sequence X of the input grape e-commerce review text into {x1, x2, x3, ..., x n} is converted to the corresponding character vector sequence E = {e1, e2, e3, ..., e n}, provide input for the upper network;
[0183] Where X represents a character sequence;
[0184] x represents a character;
[0185] e represents a character vector;
[0186] n means the nth in the sequence.
[0187] The specific process of S103 provided in the embodiment of the present invention is: for the grape e-commerce review text in the grape e-commerce review data set vectorized in S102, the three-dimensional information is preliminarily vectorized by the FirTripleBi-LSTM network of the TripleBi-LSTM module to obtain the feature coding vectors H of the three dimensions respectively. a , H o , H s ; a, o, s correspond to the three dimensions of aspect, opinion and sentiment respectively;
[0188] The three dimensions in the grape e-commerce review text data include aspect word dimension, opinion word dimension and sentiment polarity dimension.
[0189] The specific process of S104 provided in the embodiment of the present invention is: using the DualChannel-Attention mechanism to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM:
[0190] The DualChannel-Attention described above combines self-Attention and Agent-Attention, applies the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performs feature fusion on the feature encoding vector through the dual-channel attention mechanism.
[0191] The feature encoding vectors H and E obtained in S103 and S102 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows:
[0192] v 1 =J[:halflen]
[0193] v 2 =H[halflen:]
[0194] k 1 ,q 1 =E[:halflen]
[0195] k 2 ,q 2 =E[halflen:]
[0196] E up=AgentAttention(v 1 ,k 1 ,q 1 )
[0197] E low =selfAttention(v 2 ,k 2 ,q 2 )
[0198] E A =DualChannelAttention(E up +E low )
[0199] Where:
[0200] H represents the encoded feature vector of three-dimensional information obtained by the FirTripleBi-LSTM module;
[0201] E represents the original encoding vector output by BERT;
[0202] v 1 , k 1 ,q 1 They are the first layer representation vector of the input sentence X and the first half of the BERT representation vector;
[0203] v 2 , k 2 ,q 2 It is the second layer representation vector of the input sentence X and the second half of the BERT representation vector;
[0204] E up is the output of the AgentAttention module;
[0205] E low is the output of the selfAttention module;
[0206] AgentAttention(.) represents a linear attention module;
[0207] selfAttention(.) represents the self-attention module;
[0208] DualChannelAttention(.) represents the dual-channel attention module;
[0209] The DualChannel-Attention module is a Dual Channel Attention Mechanism, that is, a dual-channel attention mechanism.
[0210] The specific process of S105 is: fusion vector E of the dimensional features obtained in S104 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by the FirTripleBi-LSTM network of the TripleBi-LSTM module is used as the input of the SecTripleBi-LSTM network in the TripleBi-LSTM module. The deeper context feature information in the grape e-commerce review text is learned from the feature enhancement vector M through the SecTripleBi-LSTM to obtain the feature representation vector K.
[0211] M=E A +H
[0212] K = SecTripleBi-LSTM (M).
[0213] The specific process of S106 provided in the embodiment of the present invention is: based on the sentence feature vector K={k1, k2, k3, ..., kn} obtained in step 5, the conditional probability of the possible output label sequence Y is calculated as follows:
[0214]
[0215] S(K,Y)=∑ i,k λ k t k (y i-1 ,y i ,h,i)+∑ i,l μ l s l (y i ,h,i)
[0216] Where:
[0217] P(Y / K) represents the conditional probability of the output label sequence Y;
[0218] S(Y / K) represents the feature vector of a given sentence;
[0219] X represents the input feature vector;
[0220] Y represents the output label sequence;
[0221] Y X Represents all possible output label sequences of the input feature vector X;
[0222] K represents the sentence feature vector;
[0223] i represents the i-th index position in the sequence;
[0224] k represents the kth index sorting of the state characteristic function;
[0225] h represents the vector at position i in the sentence feature vector K;
[0226] y i Represents the label or state of a given index position i in the sequence;
[0227] t k represents the state characteristic function;
[0228] s l represents the transfer characteristic function;
[0229] λ k Represents the state characteristic function t k The weight of
[0230] μ l Denotes the transfer characteristic function s l The weight of
[0231] Finally, the output label sequence Y* with the largest conditional probability is used as the input feature vector X and the final output sequence:
[0232] Y * =argmaxP(Y / K).
[0233] like Figure 2 As shown, a fine-grained sentiment analysis system for grape e-commerce reviews with progressive transmission of three-dimensional information provided by an embodiment of the present invention includes:
[0234] Construction module, used to construct grape e-commerce review text dataset;
[0235] The vectorization module is used for the vectorization of grape e-commerce review text. The vector representation technology BERT is used to convert each character in the review text in the constructed grape e-commerce review text dataset into a character vector.
[0236] The vector encoding module is used to perform preliminary vector encoding of three-dimensional information through the FirTripleBi-LSTM of the TripleBi-LSTM module:
[0237] The fusion module is used to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM using the DualChannel-Attention mechanism:
[0238] The encoding module is used to re-encode the text feature vector of the grape e-commerce review using the SecTripleBi-LSTM network through the TripleBi-LSTM module:
[0239] The decoding module is used to decode the feature vector K using the conditional random field to obtain the final output sequence Y* of the input sentence X.
[0240] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information.
[0241] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the method for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information.
[0242] Another object of the present invention is to provide an information data processing terminal, which is used to implement the grape e-commerce review fine-grained sentiment analysis system with progressive transmission of three-dimensional information.
[0243] The present invention is specifically implemented:
[0244] Grape e-commerce review texts have characteristic information in three dimensions: aspect words, opinion words, and sentiment polarity. At the same time, there are also problems such as the lack of aspect words, the diverse expression of opinion words, and their poor recognition and sentiment polarity classification. The characteristic information between the three dimensions in the Grape e-commerce review text has a transitive contextual feature connection. If the characteristic information between the three dimensions can be combined, the recognition accuracy of this type of task can be improved.
[0245] Based on this situation, the present invention designs two modules, TripleBi-LSTM and DualChannel-Attention, to make more comprehensive use of the fine-grained three-dimensional element features in the grape e-commerce review text, and then constructs a three-dimensional information progressive transmission of grape e-commerce review fine-grained sentiment analysis method, which can effectively improve the recognition accuracy of each element in fine-grained sentiment analysis. Among them, TripleBi-LSTM can improve the model's learning and recognition capabilities of important element features; the DualChannel-Attention module can progressively transmit and fuse the information between the three-dimensional features in TripleBi-LSTM, capture the global and local features between the dimensional information, and further improve the recognition effect of fine-grained elements.
[0246] LSTM network: Long Short-Term Memory network, refers to the long short-term memory network.
[0247] Bi-LSTM network: Bidirectional Long Short-Term Memory network, refers to a bidirectional long short-term memory network.
[0248] TripleBi-LSTM network: a two-layer and three parallel Bi-LSTM network, namely, a Triple BidirectionalLong Short-Term Memory network.
[0249] DualChannel-Attention module: dual-channel attention mechanism, namely Dual Channel AttentionMechanism.
[0250] CRF layer: Conditional Random Field Layer, refers to the conditional random field layer.
[0251] In accordance with the above technical scheme, specific embodiments of the present invention are given below. It should be noted that the present invention is not limited to the following specific embodiments, and all equivalent changes made on the basis of the technical scheme of this application fall within the protection scope of the present invention.
[0252] Example:
[0253] This embodiment provides a fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information, wherein the three-dimensional information is fine-grained aspect word information, opinion word information, and sentiment polarity information. The method comprises the following steps:
[0254] Step 1: Build a grape e-commerce review text dataset.
[0255] Grape e-commerce review text data information is collected from the e-commerce platform to initially obtain data set 1; after removing duplicates and punctuation marks from data set 1, data set 2 is obtained, and the aspect words in data set 2 are annotated with BIO tags, opinion words are annotated with BO, IO and O, sentiment polarity is annotated with PMN, and the category of words is annotated after BIO; finally, the grape e-commerce review text data set GrapeEcommerce is obtained.
[0256] In the BIO tag, B represents the beginning of a word, I represents the rest of the word, and O represents other words;
[0257] In the PMN notation, P represents positive emotion, M represents moderate emotion, and N represents negative emotion.
[0258] The categories include the taste, quality, price, cost-effectiveness, packaging, weight, appearance, service, size and logistics of the grapes.
[0259] In this embodiment, data set 1 is the original unprocessed data, data set 2 is the processed but unlabeled data, and data set GrapeEcommerce is a labeled data set used for training and testing models.
[0260] Specifically in this embodiment, in order to ensure the quality of the data set, the present invention uses crawler technology to collect grape review data from the e-commerce platform. After preprocessing, a data set containing 19,220 sentences is obtained, which is named data set 1. Then the present invention removes duplicates, punctuation and emoticons from data set 1, and obtains a data set containing 18,984 sentences, which is named data set 2. And the data set 2 is annotated by BIO annotation to obtain the data set GrapeEcommerce. The present invention finally obtains a grape e-commerce review text data set containing 11 aspect word attributes, 10 opinion word attributes and 3 sentiment polarity attributes, a total of 18,984 sentences.
[0261] Step 2: Vectorize the text data of Grape e-commerce reviews:
[0262] The vector representation technology is used to convert each character in the grape e-commerce review text in the grape e-commerce review text dataset constructed in step 1 into a character vector.
[0263] The specific process of step 2 is: the character sequence X of the input grape e-commerce review text is converted into {x1, x2, x3, ..., x n} is converted to the corresponding character vector sequence E = {e1, e2, e3, ..., e n}, providing input for the upper network.
[0264] Where X represents a character sequence;
[0265] x represents a character;
[0266] e represents a character vector;
[0267] n represents the nth in the sequence;
[0268] Character vectors are used to provide raw input to the upper model.
[0269] Since the BERT model has significant advantages in sentiment analysis, its bidirectional encoding ability enables the model to understand the semantics of the context of the sentence at the same time, thereby capturing emotional tendencies more accurately. At the same time, through large-scale pre-training, BERT has learned rich language features and emotional expression patterns, enhancing its adaptability in diverse texts. The powerful scalability of BERT allows it to be flexibly applied in a variety of sentiment analysis tasks, further improving the accuracy and robustness of sentiment recognition. Therefore, the present invention selects BERT as the initial sequence vector encoding layer.
[0270] E = BERT(Transformers(X))
[0271] Step 3: For the grape e-commerce review text in the grape e-commerce review dataset vectorized in step 2, the FirTripleBi-LSTM network in the TripleBi-LSTM module performs preliminary vector encoding on the three-dimensional information to obtain the feature encoding vectors H of the three dimensions respectively. a , H o , H s a, o, and s correspond to the three dimensions of aspect, opinion, and sentiment respectively.
[0272] The three dimensions in the grape e-commerce review text data include aspect word dimension, opinion word dimension and sentiment polarity dimension.
[0273] Step 4: Use the DualChannel-Attention mechanism to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM:
[0274] The DualChannel-Attention described is based on self-Attention and Agent-Attention, combining the two, applying the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performing feature fusion on the feature encoding vector through the dual-channel attention mechanism.
[0275] The feature encoding vectors H and E obtained in step 3 and step 2 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows:
[0276] v 1 =H[:halflen]
[0277] v 2 =H[halflen:]
[0278] k 1 ,q 1 =E[:halflen]
[0279] k 2 ,q 2 =E[halflen:]
[0280] E up =AgentAttention(v 1 ,k 1 ,q 1 )
[0281] E low =selfAttention(v 2 ,k 2 ,q 2 )
[0282] E A =DualChannelAttention(E up +E low )
[0283] Where:
[0284] H represents the encoded feature vector of three-dimensional information obtained by the FirTripleBi-LSTM module;
[0285] E represents the original encoding vector output by BERT;
[0286] v 1 , k 1 ,q 1 They are the first layer representation vector of the input sentence X and the first half of the BERT representation vector;
[0287] v 2 , k 2 ,q 2 It is the second layer representation vector of the input sentence X and the second half of the BERT representation vector;
[0288] halflen means half the length of a vector;
[0289] E up is the output of the AgentAttention module;
[0290] E low is the output of the selfAttention module;
[0291] AgentAttention(.) represents a linear attention module;
[0292] selfAttention(.) represents the self-attention module;
[0293] DualChannelAttention(.) represents a dual-channel attention module.
[0294] Step 5: Use the SecTripleBi-LSTM network in the TripleBi-LSTM module to re-encode the feature vector of the Grape e-commerce review text:
[0295] The progressive dimensional feature fusion vector E obtained in step 4 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by the FirTripleBi-LSTM network in the TripleBi-LSTM module is used as the input of the SecTripleBi-LSTM module. The SecTripleBi-LSTM network in the TripleBi-LSTM module learns the deeper context feature information in the grape e-commerce review text from the feature enhancement vector M to obtain the feature representation vector K.
[0296] M=H+E A
[0297] K=SecTripleBi-LSTM(M)
[0298] like Figure 3 As shown, further elaboration of the contents of this step is as follows.
[0299] First, the implementation details of the basic LSTM network and the Bi-LSTM network are introduced.
[0300] The LSTM network is composed of a forget gate, an input gate, and an output gate, and the three gates control the information flow in the network.
[0301] Assuming that the character xt at time step t is initially vectorized to obtain the character representation xtc, the one-way LSTM calculation is as follows:
[0302]
[0303] h t =o t ⊙tanh (c t )
[0304] Where:
[0305] σ represents the sigmoid activation function;
[0306] tanh is the hyperbolic tangent activation function;
[0307] i, f, o, c,represent the input gate, forget gate, output gate, and memory cell at time t, respectively;
[0308] W and b represent the weight matrix and bias vector in the corresponding gate, respectively;
[0309] x t Represents the input vector at time t;
[0310] represents the candidate memory cell at time t;
[0311] h t is the hidden state of the LSTM unit, that is, the output of each unit;
[0312] ⊙ is the element-wise dot product calculation.
[0313] Second, based on the first point above, the Bi-LSTM network can be formally expressed as the following formula:
[0314]
[0315] Where:
[0316] The superscript c indicates the character features obtained by processing;
[0317] represents the input features at time step t;
[0318] With different direction labels Represent the hidden states of the forward and backward TripleBi-LSTM respectively;
[0319] Represents a two-way state merge at time t.
[0320] The outputs of the forward and backward LSTM networks are concatenated to obtain the encoded representation of the character at time step t, which serves as the input of the next CRF layer.
[0321] Third, based on LSTM and Bi-LSTM, the main contributions and improvements of the TripleBi-LSTM network proposed in the present invention can be summarized into the following two points.
[0322] (1) Parallel processing of three-dimensional information. The TripleBi-LSTM network proposed in the present invention processes aspect word information, opinion word information, and sentiment polarity information respectively through two layers of three parallel long short-term memory networks. By processing the context feature information of three dimensions in parallel, each Bi-LSTM focuses on the recognition and extraction of a fine-grained element, and at the same time, the three-dimensional information of the sentiment element is progressively transmitted in the TripleBi-LSTM network, further improving the learning ability of the model and the recognition accuracy of fine-grained elements.
[0323] (2) Three-dimensional information progressive transmission processing. The combination of TripleBi-LSTM and DualChannel-Attention proposed in the present invention enables the information between the three dimensions of fine-grained elements to be progressively integrated and interacted. The feature information in the aspect word dimension is transmitted to the opinion word recognition module, and the aspect word dimension information is integrated in the opinion word recognition; the features in the opinion word dimension are transmitted to the sentiment polarity classification module, and are combined with the features of the opinion word dimension information in the sentiment polarity classification; that is, the features of the aspect words are used in the opinion word recognition, and the features of the opinion words are used in the sentiment polarity classification, thereby improving the accuracy and completeness of the aspect word recognition of the grape e-commerce review text, and improving the accuracy of the opinion word recognition and sentiment classification.
[0324] Step 6: Use the conditional random field to decode the feature vector K to obtain the final output sequence Y* of the input sentence X.
[0325] Specifically:
[0326] Based on the sentence feature vector K=(k1, k2, ..., k n ), calculate the conditional probability of the possible output label sequence Y, which is calculated as follows:
[0327]
[0328] S(K,Y)=∑ i,k λ k t k yi-1,yi,h,i)+∑ i,l μ l s l (y i ,h,i)
[0329] In the formula, P(Y / K) represents the conditional probability of the output label sequence Y;
[0330] S(Y / K) represents the feature vector of a given sentence;
[0331] X represents the input feature vector;
[0332] Y represents the output label sequence;
[0333] Y X Represents all possible output label sequences of the input feature vector X;
[0334] K represents the sentence feature vector;
[0335] i represents the i-th index position in the sequence;
[0336] k represents the kth index sorting of the state characteristic function;
[0337] h represents the vector at position i in the sentence feature vector K;
[0338] y i Represents the label or state of a given index position i in the sequence;
[0339] t k represents the state characteristic function;
[0340] s l represents the transfer characteristic function;
[0341] λ k Represents the state characteristic function t k The weight of
[0342] μ l Denotes the transfer characteristic function s l The weight of
[0343] Finally, the output label sequence Y* with the largest conditional probability is used as the input feature vector X and the final output sequence:
[0344] Y * =argmaxP(Y / K)
[0345] Performance comparison:
[0346] In order to verify the effectiveness of the present invention, the present invention conducted a comparative experiment with four models on the self-built grape review text dataset mentioned in step 1 of the above embodiment. The four comparative models are as follows:
[0347] Comparison method (1): Basic baseline model BERT+BiLSTM+CRF.
[0348] Comparative method (2): The SDRN model uses two parallel units in a dual-channel recurrent network, the entity extraction unit and the relationship detection unit. At the same time, the model also includes an entity synchronization mechanism and a relationship synchronization mechanism to extract aspect words and opinion words.
[0349] Comparative method (3): PARAPHRASE modeling method ABSA-QUAD, which frames the ASQP (aspect sentiment quadprediction) task as a paraphrase generation process.
[0350] Comparative method (4): Span-level bidirectional network SBN, which takes all possible spans as input and extracts sentiment triplets bidirectionally.
[0351] The commonly used standards for evaluating sentiment analysis models are precision, recall, and F1 score. Among all the results predicted as positive samples, the more positive samples predicted correctly, the higher the P value; the more positive samples in the test data are predicted correctly, the higher the R value; the F1 score is the harmonic mean of P and R, which is an evaluation of the comprehensive ability of the model.
[0352] The corresponding calculation formula is:
[0353]
[0354] T P That is, True Positives, which is expressed as the number of positive samples correctly identified among all positive samples;
[0355] F P That is, False Positives, which indicates the number of negative samples that are mistakenly identified as positive samples;
[0356] F N False Negatives, which means the number of positive samples that are mistakenly identified as negative samples
[0357] Table 1 Effects of the present invention and four comparative methods
[0358]
[0359] Table 1 is a comparison between different models. It can be seen from the table that the method proposed in the present invention has achieved the best comprehensive results in the model evaluation on the three subtasks compared with the comparative methods (1)(2)(3)(4).
[0360] 1. Specific application fields or related products of the present invention.
[0361] (1) Analysis of user comments on e-commerce platforms: On e-commerce platforms, user comments are huge in number and rich in information. The fine-grained sentiment analysis method for grape e-commerce comments of the present invention can accurately extract aspect words, opinion words and sentiment polarity in user comments on grape products, helping e-commerce platforms to monitor user feedback in real time and optimize products and services.
[0362] (2) Market research tools: Relevant enterprises can use the technical solution of the present invention to develop market research tools, conduct in-depth analysis of user evaluation texts of grape products, identify market demand and consumption trends, and thus formulate more effective market strategies and product improvement plans.
[0363] (3) Intelligent recommendation system: By performing sentiment analysis on user comments on grape products, the present invention can provide a more accurate user portrait and recommendation basis for the intelligent recommendation system of the e-commerce platform, realize a personalized shopping experience, and improve user satisfaction and purchase conversion rate.
[0364] (4) Social media sentiment monitoring: The technical solution of the present invention is also applicable to social media platforms, helping companies and brands monitor the public’s sentiment towards their products or services, respond to negative feedback in a timely manner, and maintain their brand image.
[0365] (5) Product quality feedback system: Relevant enterprises can apply the present invention to the product quality feedback system to automatically analyze user feedback, identify product quality issues, and promote product improvement and quality management.
[0366] (6) Data analysis service: The technical solution of the present invention can be integrated into a data analysis service platform to provide sentiment analysis and text mining solutions for customers in various industries, helping them to extract valuable information from big data.
[0367] 2. Relevant evidence of the technical effects obtained by the embodiments of the present invention.
[0368] (I) Experimental design and data analysis
[0369] In the implementation of the present invention, we conducted a fine-grained sentiment analysis experiment on a self-built grape e-commerce review dataset. The dataset contains 18,984 user reviews, annotated with aspect words, opinion words, and sentiment polarity, with a training set and test set ratio of 8:2. The experiment is divided into the following steps:
[0370] Data preprocessing: Clean, remove duplicates, and remove symbols from the comment text, and use the text vectorization method to construct the initial feature vector.
[0371] Model training and testing: The TripleBi-LSTM and DualChannel-Attention models of the present invention are used for training, and compared with the traditional BERT+BiLSTM+CRF and the existing advanced models SDRN, ABSA-QUAD and SBN.
[0372] (II) Experimental results
[0373] The experimental results show that the recognition accuracy of words, opinion words and sentiment polarity using the model of the present invention is significantly improved compared with the traditional model. The specific data are as follows:
[0374]
[0375] (III) Graphical display of experimental results
[0376] To show the experimental results more intuitively:
[0377] from Figure 5 and Figure 6 It can be seen that the recognition accuracy of the TripleBi-LSTM and DualChannel-Attention combined model of the present invention in each dimension and the overall performance of the model are significantly higher than those of the traditional model.
[0378] (IV) Theoretical Analysis
[0379] The dual-channel attention mechanism adopted by the present invention theoretically provides a more comprehensive and detailed way to capture the contextual information in the comments. Traditional models usually rely on a single feature extraction method, which may lead to the loss and deviation of important information, especially when faced with complex emotions and multi-dimensional data, the performance of the model is often unsatisfactory.
[0380] By introducing a dual-channel attention mechanism, the present invention can simultaneously fuse global features and local features, making the information extraction process more comprehensive. Global features focus on the overall context of the review, which helps capture potential sentiment trends and changes in user attitudes; while local features can accurately capture details in the review, such as specific aspect words and opinion words. This dual focus makes the model more robust and adaptable when dealing with complex emotions.
[0381] In addition, the design of the dual-channel attention mechanism enables the model to effectively avoid interference between features when performing information fusion. By independently extracting global and local features and then fusing them, the model can maintain the complementarity between the features, thereby enhancing the richness and diversity of the overall feature representation.
[0382] In theory, this feature fusion method provides the model with a deeper level of semantic understanding and can better understand the potential emotional tendencies in comments. In addition, the dual-channel attention mechanism can optimize attention allocation through adaptive learning, allowing the model to flexibly adjust its feature extraction strategy in different scenarios. This dynamic adjustment capability significantly improves the generalization ability of the model, enabling it to maintain excellent performance in a variety of application scenarios.
[0383] In summary, the dual-channel attention mechanism proposed in the present invention not only constructs a more sound feature extraction framework in theory, but also improves the recognition accuracy of the model in fine-grained emotional elements through comprehensive capture and refined processing of information.
[0384] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. A person of ordinary skill in the art will appreciate that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0385] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A fine-grained sentiment analysis method for grape e-commerce reviews with three-dimensional information progressive transmission, characterized in that: By constructing a text dataset of grape e-commerce reviews and using BERT vectorization to process the review text, the FirTripleBi-LSTM of the TripleBi-LSTM module is used to preliminarily encode the three-dimensional information of aspect words, opinion words, and sentiment polarity in the reviews. Subsequently, the DualChannel-Attention mechanism is used to combine self-Attention and Agent-Attention in TripleBi-LSTM to achieve global and local information fusion of the three-dimensional features and obtain an enhanced dimensional feature vector. Furthermore, the fused feature vector is re-encoded by SecTripleBi-LSTM, and finally the encoded feature vector is decoded using the conditional random field to obtain the output sequence of fine-grained sentiment analysis.
2. The fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information as claimed in claim 1 is characterized in that: The following steps are involved: Step 1: Build a grape e-commerce review text dataset; Step 2: vectorization of grape e-commerce review text; Use the vector representation technology BERT to convert each character in the comment text in the grape e-commerce comment text dataset constructed in step 1 into a character vector; Step 3: Perform preliminary vector encoding of the three-dimensional information through the FirTripleBi-LSTM of the TripleBi-LSTM module: For the grape e-commerce review text in the grape e-commerce review data set vectorized in step 2, the three-dimensional information is preliminarily vectorized by the FirTripleBi-LSTM module to obtain feature encoding vectors of the three dimensions respectively; the three dimensions in the grape e-commerce review text data include aspect word dimension, opinion word dimension and sentiment polarity dimension; The calculation process of the FirTripleBi-LSTM module for preliminary vectorization of the Grape e-commerce review text is as follows: The character xt represents the character encoding vector at time step t, and are the vector representations of the previous step and the next step respectively, Represents the character encoding vector representation obtained by cascading forward and backward; Step 4: Use the DualChannel-Attention mechanism to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM: The DualChannel-Attention described above combines self-Attention and Agent-Attention, applies the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performs global and local feature fusion on the feature encoding vector through the dual-channel attention mechanism. The feature encoding vectors H and E obtained in step 3 and step 2 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows: v 1 =H[:half] v 2 H[half:] k 1 ,q 1 =E[:halves] k 2 ,q 2 =E[half:] E up =AgentAttention(v 1 ,k 1 ,q 1 ) E low =selfAttention(v 2 ,k 2 ,q 2 ) Yes A =DualChannelAttention(E up +E low ) Where: H represents the encoded feature vector of three-dimensional information obtained by the FirTripleBi-LSTM module; E represents the original encoding vector output by BERT; v 1 , k 1 ,q 1 They are the first layer representation vector of the input sentence X and the first half of the BERT representation vector; v 2 , k 2 ,q 2 It is the second layer representation vector of the input sentence X and the second half of the BERT representation vector; E up is the output of the AgentAttention module; E low is the output of the selfAttention module; AgentAttention(.) represents a linear attention module; selfAttention(.) represents the self-attention module; DualChannelAttention(.) represents the dual-channel attention module; The DualChannel-Attention module is a Dual Channel Attention Mechanism, i.e., a dual-channel attention mechanism; Step 5: Use the SecTripleBi-LSTM network through the TripleBi-LSTM module to re-encode the Grape e-commerce review text feature vector: The progressively enhanced dimensional feature fusion vector E obtained in step 4 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by FirTripleBi-LSTM is used as the input of the SecTripleBi-LSTM module. The deeper context feature information in the grape e-commerce review text is learned from the feature enhancement vector M through SecTripleBi-LSTM to obtain the feature representation vector K. M=E A +H K=SecTripleBi-LSTM(M) Step 6: Use the conditional random field to decode the feature vector K and obtain the final output sequence Y* of the input sentence X.
3. The fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information as claimed in claim 1 is characterized in that: The specific process of step 1 is as follows: collect grape e-commerce review text data information from the e-commerce platform to initially obtain data set 1; obtain data set 2 by removing duplicates and punctuation marks from data set 1, and use BIO tags to annotate aspect words in data set 2, use BO, IO and O to annotate opinion words, use PMN to annotate sentiment polarity, and annotate word categories after BIO at the same time; finally obtain the grape e-commerce review text data set GrapeEcommerce; In the BIO tag, B represents the beginning of a word, I represents the rest of the word, and O represents other words; In the PMN notation, P represents positive emotion, M represents moderate emotion, and N represents negative emotion. The categories include the taste, quality, price, cost-effectiveness, packaging, weight, appearance, service, size and logistics of the grapes.
4. The fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information as claimed in claim 1 is characterized in that: The specific process of step 2 is: using vector representation technology to convert each character in the grape e-commerce review text in the grape e-commerce review text data set constructed in step 1 into a character vector; The specific process of step 2 is: the character sequence X of the input grape e-commerce review text is converted into {x1, x2, x3, ..., x n } is converted to the corresponding character vector sequence E = {e1, e2, e3, ..., e n }, provide input for the upper network; Where X represents a character sequence; x represents a character; e represents a character vector; n means the nth in the sequence.
5. The fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information as claimed in claim 1 is characterized in that: The specific process of step 3 is as follows: for the grape e-commerce review text in the grape e-commerce review data set vectorized in step 2, the three-dimensional information is preliminarily vectorized through the FirTripleBi-LSTM network of the TripleBi-LSTM module to obtain the feature coding vectors H of the three dimensions respectively. a , H o , H s ; a, o, s correspond to the three dimensions of aspect, opinion and sentiment respectively; The three dimensions in the grape e-commerce review text data include aspect word dimension, opinion word dimension and sentiment polarity dimension.
6. The fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information as claimed in claim 1 is characterized in that: The specific process of step 4 is: using the DualChannel-Attention mechanism to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM: The DualChannel-Attention described above combines self-Attention and Agent-Attention, applies the Agent-Attention mechanism in the upper layer and the self-Attention mechanism in the lower layer, and performs feature fusion on the feature encoding vector through the dual-channel attention mechanism. The feature encoding vectors H and E obtained in step 3 and step 2 are used as the input feature vectors of DualChannel-Attention. Based on the upper-layer Agent-Attention and the lower-layer self-Attention structure, the global features and local features in the text sentences of the grape e-commerce review are captured respectively, and the dimensional feature fusion vector E is obtained. A , the specific formula is as follows: v 1 =H[:half] v 2 H[half:] k 1 ,q 1 =E[:halves] k 2 ,q 2 =E[halflen:] E up =AgentAttention(v 1 ,k 1 ,q 1 ) E low =selfAttention(v 2 ,k 2 ,q 2 ) Yes A =DualChannelAttention(E up +E low ) Among them, H represents the encoding feature vector of the three-dimensional information obtained by the FirTripleBi-LSTM module; E represents the original encoding vector output by BERT; v 1 , k 1 ,q 1 are the first-layer representation vector of the input sentence X and the first half of the BERT representation vector; v 2 , k 2 ,q 2 is the second layer representation vector of the input sentence X and the second half of the BERT representation vector; halflen represents half of the vector length; E up is the output of the AgentAttention module; E low is the output of the selfAttention module; AgentAttention(.) represents the linear attention module; selfAttention(.) represents the self-attention module; DualChannelAttention(.) represents the dual-channel attention module; The DualChannel-Attention module is a Dual Channel Attention Mechanism, i.e., a dual-channel attention mechanism; The specific process of step 5 is: fusion vector E obtained by step 4 A The feature enhancement vector M of the grape e-commerce review text obtained by adding the feature encoding vector H obtained by the FirTripleBi-LSTM network of the TripleBi-LSTM module is used as the input of the SecTripleBi-LSTM network in the TripleBi-LSTM module. The deeper context feature information in the grape e-commerce review text is learned from the feature enhancement vector M through the SecTripleBi-LSTM to obtain the feature representation vector K. M=E A +H K=SecTripleBi-LSTM(M) 7. The fine-grained sentiment analysis method for grape e-commerce reviews with progressive transmission of three-dimensional information as claimed in claim 1 is characterized in that: The specific process of step 6 is: based on the sentence feature vector K obtained in step 5, K={k1, k2, k3, ..., k n }, calculate the conditional probability of the possible output label sequence Y, which is calculated as follows: in: P(Y / K) represents the conditional probability of the output label sequence Y; S(Y / K) represents the feature vector of a given sentence; X represents the input feature vector; Y represents the output label sequence; YX represents all possible output label sequences of the input feature vector X; K represents the sentence feature vector; i represents the i-th index position in the sequence; k represents the kth index sorting of the state characteristic function; h represents the vector at position i in the sentence feature vector K; yi represents the label or state of a given index position i in the sequence; t k represents the state characteristic function; s l represents the transfer characteristic function; λ k Represents the state characteristic function t k The weight of μ l Denotes the transfer characteristic function s l The weight of Finally, the output label sequence Y* with the largest conditional probability is used as the input feature vector X and the final output sequence: Y * =argmaxP(Y / K)。 8. A system for fine-grained sentiment analysis of grape e-commerce reviews using three-dimensional information progressive transmission, which implements the method for fine-grained sentiment analysis of grape e-commerce reviews using three-dimensional information progressive transmission as claimed in any one of claims 1 to 7, characterized in that: The grape e-commerce review fine-grained sentiment analysis system with progressive transmission of three-dimensional information includes: Construction module, used to construct grape e-commerce review text dataset; The vectorization module is used for vectorization of grape e-commerce review text. The vector representation technology BERT is used to convert each character in the review text in the constructed grape e-commerce review text dataset into a character vector. The vector encoding module is used to perform preliminary vector encoding of three-dimensional information through the FirTripleBi-LSTM of the TripleBi-LSTM module: The fusion module is used to progressively transfer and fuse the feature information between the three-dimensional modules in TripleBi-LSTM using the DualChannel-Attention mechanism: The encoding module is used to re-encode the text feature vector of the grape e-commerce review using the SecTripleBi-LSTM network through the TripleBi-LSTM module: The decoding module is used to decode the feature vector K using the conditional random field to obtain the final output sequence Y* of the input sentence X.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for fine-grained sentiment analysis of grape e-commerce reviews with progressive transmission of three-dimensional information as described in any one of claims 1-6.
10. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the grape e-commerce review fine-grained sentiment analysis system with progressive transmission of three-dimensional information as described in claim 7.