A product review sentiment analysis method based on MS-PSO and deep learning

Through a hybrid feature deep learning network optimized by dynamic word vector representation and MS-PSO, the problem of insufficient feature extraction and improper hyperparameter configuration of deep learning models in product review sentiment analysis is solved, achieving more efficient emotion classification effect, and improving analysis accuracy and stability.

CN120234678BActive Publication Date: 2025-08-22SICHUAN UNIVERSITY OF SCIENCE AND ENGINEERING +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510732080.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-08-22
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

In the product review sentiment analysis, existing deep learning models have problems such as insufficient feature extraction, insufficient fine-grained emotional distinction ability, and improper hyperparameter configuration. Especially when multimodal feature fusion is difficult to achieve efficient parameter optimization under limited computing resources.

Method used

Dynamic word vector representation technology is used to combine mixed feature deep learning networks, and the neural network hyperparameters are optimized through improved random mirror particle swarm optimization algorithm (MS-PSO), and multi-scale convolutional features and sequence-dependent features are connected in series to improve the accuracy and efficiency of emotional classification.

Benefits of technology

Through a hybrid feature deep learning network optimized by dynamic word vector representation and MS-PSO, we can more accurately and comprehensively explore commentary emotional information, improve the accuracy and efficiency of emotional classification, and provide technical support for enterprises to optimize product design and service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234678B_ABST
    Figure CN120234678B_ABST
Patent Text Reader

Abstract

The present invention provides a product review sentiment analysis method based on MS-PSO and deep learning, which belongs to the field of sentiment analysis. The method comprises the following steps: obtaining product review text and sentiment classification, and preprocessing text data; converting the preprocessed text into a dynamic word-level representation tensor through DistilBERT, and converting the sentiment classification label into an integer code; optimizing the hyperparameters of a parallel-connected hybrid feature deep learning network through a random mirror particle swarm algorithm; training a parallel-connected hybrid feature deep learning network model based on the optimal hyperparameters; preprocessing the text data to be sentimentally classified, encoding it through a DistilBERT model, and then inputting it into the trained model to obtain sentiment classification. The method can improve the accuracy of sentiment analysis of product reviews, and provide a basis for enterprises to understand user needs and improve products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text sentiment analysis, and in particular to a product review sentiment analysis method based on MS-PSO and deep learning. Background Art

[0002] Sentiment analysis of text reviews is a computational task that automatically identifies the emotional tendencies expressed in review text. With the rapid development of e-commerce, the number of user-generated product reviews has increased dramatically. The emotional information contained in these reviews not only directly influences potential consumers' purchasing decisions but also provides a key basis for companies to optimize product design and improve service quality.

[0003] Compared to regular text, product reviews are characterized by colloquial expressions and sparse features, and they often contain domain-specific vocabulary, which increases the difficulty of semantic parsing. Currently, deep learning has become the mainstream method for sentiment analysis of product reviews, but single neural network models suffer from problems such as insufficient feature extraction and insufficient fine-grained sentiment differentiation capabilities, prompting researchers to turn to hybrid model architectures to improve performance. In addition, the classification effect of neural network models is highly dependent on hyperparameter settings, and improper hyperparameter configuration can significantly reduce analysis accuracy. Although intelligent optimization algorithms can be used for hyperparameter tuning, existing methods still have limitations in convergence speed and optimization accuracy. In particular, for complex models that fuse multimodal features, efficient parameter optimization with limited computing resources is more practical. Summary of the Invention

[0004] The purpose of the present invention is to provide a product review sentiment analysis method based on MS-PSO and deep learning. The method solves the problem of inaccurate semantic representation of traditional static word vectors through dynamic word vector representation technology, adopts parallel and serial hybrid feature deep learning network to integrate multi-scale convolution features and sequence dependency features to overcome the defect of insufficient feature extraction capability of a single model, and utilizes the improved random mirror particle swarm optimization algorithm (MS-PSO) to achieve efficient optimization of neural network hyperparameters, thereby improving the accuracy and efficiency of sentiment classification, and providing reliable technical support for enterprises to optimize product design and improve service quality.

[0005] The present invention is achieved in that:

[0006] The technical solution to achieve the purpose of the present invention is: a product review sentiment analysis method based on MS-PSO and deep learning, including the following steps:

[0007] Step 1: Obtain the product review text and sentiment classification dataset required for training the model, and preprocess the product review text through the preprocessing module;

[0008] Step 2: Encode the preprocessed product reviews using a lightweight DistilBERT model, extract the contextual hidden states of all subword tokens as dynamic word-level representation tensors, and convert the sentiment classification labels into integer encodings.

[0009] Step 3: Set the parameters required by the random mirror particle swarm algorithm and the optimization range of the hyperparameters to be optimized of the series hybrid feature deep learning network;

[0010] Step 4: Optimize and concatenate the hyperparameters of the hybrid feature deep learning network using random mirror particle swarm optimization;

[0011] Step 5: Based on the optimized hyperparameters, train and concatenate the hybrid feature deep learning network model;

[0012] Step 6: Obtain product reviews to be sentimentally classified, preprocess them through the preprocessing module, encode them through the DistilBERT model, extract the dynamic word-level representation tensor, and input them into the trained parallel-serial hybrid feature deep learning network model to obtain sentiment classification.

[0013] Furthermore, in step one, the preprocessing module includes text cleaning, text length truncation, stop word removal, word segmentation, and product feature word unification; wherein, the product feature word unification is the feature vocabulary for product brands, models, component names and performance parameters, which are standardized into preset unified vocabulary based on a synonym dictionary.

[0014] The preprocessing module can effectively remove noise data from reviews, improve the accuracy of product feature recognition, and ultimately enhance sentiment classification performance.

[0015] Furthermore, in step 3, the random mirror particle swarm algorithm is an improved algorithm in the particle swarm optimization algorithm, and its steps include:

[0016] (1) Particle initialization

[0017] Similar to the particle swarm optimization algorithm, the initial particles are generated by random initialization:

[0018] X i =lb+(ub-lb)×rand(1,dim)

[0019] Where i is the particle number, X i represents the position of the i-th particle, lb is the lower limit of the optimization range, ub is the upper limit of the optimization range, rand(1,dim) represents a dim-dimensional vector composed of random numbers between 0 and 1, and dim is the dimension of the solution domain;

[0020] After generating the initial particles, calculate the fitness values ​​of all particles;

[0021] (2) Particle Update

[0022] In each round of iteration, a random number R between 0 and 1 is generated for each particle i. i , and according to R i The value selection is direct update or mirror update:

[0023] Case 1: When R i ≥0.5, the particle is directly updated, and the direct update method is:

[0024] V i =(1-t / T)V i / 2+c1r1(P i -X i )+c2r2(GX i )

[0025] X i =X i +V i

[0026] Among them, V i represents the speed of particle i, t represents the current number of iterations, T represents the maximum number of iterations, c1 is the individual optimal item learning factor, c2 is the global optimal item learning factor; r1 is a random number between 0 and 1, r2 is a random number between 0 and 1, P i represents the optimal position of particle i in the search history, and G represents the position of the global optimal solution;

[0027] Case 2: When R i <0.5, the particle is updated as a mirror image, which is divided into 3 sub-steps:

[0028] Sub-step 1: Generate a mirror particle of particle i with G as the center, and the position is X m,i Represented, and the original particle i is deleted:

[0029] PE=0.1×(rand(1,dim)-0.5)×(ub-lb)

[0030] X m,i =2×GX i +PE×(1-t / T)

[0031] Among them, PE is the random disturbance;

[0032] Sub-step 2: Determine whether the mirror particle exceeds the optimization range in each dimension. If it exceeds the optimization range in the jth dimension, correct the position of dimension j:

[0033] X m,i,j =ub j+R i ×(ub j -X m,i,j ) If X m,i,j >ub j

[0034] X m,i,j =lb j +R i ×(lb j -X m,i,j ) If X m,i,j <lb j

[0035] where X m,i,j is the corrected mirror image position of the i-th particle in the j-th dimension, j = 1, 2, ..., M; ub j and lb j Respectively represent the upper and lower limits of the optimization range in the jth dimension;

[0036] Sub-step 3: Update the particle position and velocity based on the mirror image:

[0037] X i =X m,i +rand(1,dim)×(GX m,i )

[0038] V i =0

[0039] (3) Particle elimination

[0040] Recalculate the fitness values ​​of all particles and update P i and G, delete the particle with the worst fitness value and generate a new particle in the solution domain by random initialization;

[0041] Finally, determine whether the termination condition is met. If not, repeat steps (2) to (3) until the iteration termination condition is met. If it is met, output the global optimal position and optimal solution.

[0042] The MS-PSO method improves the diversity of particle search space coverage and convergence efficiency through the random mirror update mechanism, and improves the search space coverage through adaptive boundary processing, while the particle elimination mechanism maintains the population diversity at the optimal level.

[0043] Furthermore, in step three, the parameters required for the random mirror particle swarm algorithm include the individual optimal item learning factor c1 and the global optimal item learning factor c2; the hyperparameters to be optimized of the parallel-series hybrid feature deep learning network include the number of filters of the multi-scale convolutional layer, the learning rate, the random dropout rate, the L2 regularization strength, the number of units in the long short-term memory layer, and the number of heads in the multi-head attention mechanism.

[0044] Furthermore, in step 3, the parallel-series hybrid feature deep learning network includes the following modules:

[0045] (1) Input layer module: Receives the dynamic word-level representation tensor generated by the DistilBERT model, whose dimension is (batch size, sequence length, embedding dimension); (2) Parallel channel module: The input layer module is connected to the upper and lower parallel channel modules, where the upper channel consists of a multi-scale one-dimensional convolution layer group, a maximum pooling layer corresponding to each convolution output, a feature dimension splicing layer and a global maximum pooling layer, and the lower channel consists of a bidirectional gated recurrent unit layer and a global maximum pooling layer; (3) Multi-head self-attention mechanism module: The outputs of the upper and lower channels are spliced ​​along the feature dimension, and the spliced ​​two-dimensional features are reshaped into three-dimensional features, and input into the multi-head self-attention mechanism for calculation; (4) Classification output module: The output results of the multi-head self-attention mechanism are sequentially passed through the random dropout layer, the flattening layer and the fully connected layer and then input into the classification output module to obtain the classification output results.

[0046] The beneficial effects of the present invention are as follows: the present invention provides a product review sentiment analysis method based on MS-PSO and deep learning. Among them, the dynamic word-level representation tensor of the text can be obtained by DistilBERT, and the parallel-serial hybrid feature deep learning network model optimized by MS-PSO can mine more accurate, comprehensive and deeper review sentiment information. Among them, the multi-scale convolutional neural network (CNN) can obtain local information of different scales through convolution kernels of different sizes; the bidirectional gated recurrent unit (GRU) can fully explore the global and temporal information, and the multi-head self-attention mechanism (MHSA) can calculate the dependency between features, thereby automatically focusing on the key features of classification decisions; the random mirror particle swarm algorithm (Mirrored Stochastic Particle Swarm Optimization, MS-PSO) is a new type of PSO improved algorithm proposed by the present invention. By optimizing the hyperparameters of the model through the MS-PSO algorithm, the model can have better classification effect, providing reliable technical support for improving the sentiment classification effect of online reviews. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 This is a flowchart of a product review sentiment analysis method based on MS-PSO and deep learning provided by an embodiment of the present invention;

[0049] Figure 2 It is a detailed flow chart of the MS-PSO optimization algorithm provided by an embodiment of the present invention;

[0050] Figure 3 This is a diagram of the parallel-series hybrid feature deep learning network structure provided by an embodiment of the present invention;

[0051] Figure 4 This is a comparison of the accuracy box plots of each model under 20 calculations; DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in combination with the implementation cases and drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention for which protection is sought, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0053] The method of the present invention is described below using a specific case study of sentiment analysis of Chinese reviews as an example.

[0054] like Figure 1 , a product review sentiment analysis method based on MS-PSO and deep learning, including the following steps:

[0055] Step 1: Obtain the product review text and sentiment classification dataset required for training the model, and preprocess the product review text through the preprocessing module;

[0056] Step 2: Encode the preprocessed product reviews using a lightweight DistilBERT model, extract the contextual hidden states of all subword tokens as dynamic word-level representation tensors, and convert the sentiment classification labels into integer encodings.

[0057] Step 3: Set the parameters required by the random mirror particle swarm algorithm and the optimization range of the hyperparameters to be optimized of the series hybrid feature deep learning network;

[0058] Step 4: Optimize and concatenate the hyperparameters of the hybrid feature deep learning network using random mirror particle swarm optimization;

[0059] Step 5: Based on the optimized hyperparameters, train and concatenate the hybrid feature deep learning network model;

[0060] Step 6: Obtain product reviews to be sentimentally classified, preprocess them through the preprocessing module, encode them through the DistilBERT model, extract the dynamic word-level representation tensor, and input them into the trained parallel-serial hybrid feature deep learning network model to obtain sentiment classification.

[0061] Furthermore, in step one, the preprocessing module includes text cleaning, text length truncation, stop word removal, word segmentation, and product feature word unification; wherein, the product feature word unification is the feature vocabulary for product brands, models, component names and performance parameters, which are standardized into preset unified vocabulary based on a synonym dictionary.

[0062] The preprocessing module can effectively remove noise data from reviews, improve the accuracy of product feature recognition, and ultimately enhance sentiment classification performance.

[0063] Furthermore, in step 3, the random mirror particle swarm algorithm is an improved algorithm in the particle swarm optimization algorithm, and its steps include:

[0064] (1) Particle initialization

[0065] Similar to the particle swarm optimization algorithm, the initial particles are generated by random initialization:

[0066] X i =lb+(ub-lb)×rand(1,dim)

[0067] Where i is the particle number, X i represents the position of the i-th particle, lb is the lower limit of the optimization range, ub is the upper limit of the optimization range, rand(1,dim) represents a dim-dimensional vector composed of random numbers between 0 and 1, and dim is the dimension of the solution domain;

[0068] After generating the initial particles, calculate the fitness values ​​of all particles;

[0069] (2) Particle Update

[0070] In each round of iteration, a random number R between 0 and 1 is generated for each particle i. i , and according to R i The value selection is direct update or mirror update:

[0071] Case 1: When R i ≥0.5, the particle is directly updated, and the direct update method is:

[0072] V i =(1-t / T)V i / 2+c1r1(P i -X i )+c2r2(GX i )

[0073] X i =X i +V i

[0074] Among them, V i represents the speed of particle i, t represents the current number of iterations, T represents the maximum number of iterations, c1 is the individual optimal item learning factor, c2 is the global optimal item learning factor; r1 is a random number between 0 and 1, r2 is a random number between 0 and 1, P i represents the optimal position of particle i in the search history, and G represents the position of the global optimal solution;

[0075] Case 2: When R i <0.5, the particle is updated as a mirror image, which is divided into 3 sub-steps:

[0076] Sub-step 1: Generate a mirror particle of particle i with G as the center, and the position is X m,i Represented, and the original particle i is deleted:

[0077] PE=0.1×(rand(1,dim)-0.5)×(ub-lb)

[0078] X m,i =2×GX i +PE×(1-t / T)

[0079] Among them, PE is the random disturbance;

[0080] Sub-step 2: Determine whether the mirror particle exceeds the optimization range in each dimension. If it exceeds the optimization range in the jth dimension, correct the position of dimension j:

[0081] X m,i,j =ub j+R i ×(ub j -X m,i,j ) If X m,i,j >ub j

[0082] X m,i,j =lb j +R i ×(lb j -X m,i,j ) If X m,i,j <lb j

[0083] where X m,i,j is the corrected mirror image position of the i-th particle in the j-th dimension, j = 1, 2, ..., M; ub j and lb j Respectively represent the upper and lower limits of the optimization range in the jth dimension;

[0084] Sub-step 3: Update the particle position and velocity based on the mirror image:

[0085] X i =X m,i +rand(1,dim)×(GX m,i )

[0086] V i =0

[0087] (3) Particle elimination

[0088] Recalculate the fitness values ​​of all particles and update P i and G, delete the particle with the worst fitness value and generate a new particle in the solution domain by random initialization;

[0089] Finally, determine whether the termination condition is met. If not, repeat steps (2) to (3) until the iteration termination condition is met. If it is met, output the global optimal position and optimal solution.

[0090] The MS-PSO method improves the diversity of particle search space coverage and convergence efficiency through the random mirror update mechanism, and improves the search space coverage through adaptive boundary processing, while the particle elimination mechanism maintains the population diversity at the optimal level.

[0091] Furthermore, in step three, the parameters required for the random mirror particle swarm algorithm include the individual optimal item learning factor c1 and the global optimal item learning factor c2; the hyperparameters to be optimized of the parallel-series hybrid feature deep learning network include the number of filters of the multi-scale convolutional layer, the learning rate, the random dropout rate, the L2 regularization strength, the number of units in the long short-term memory layer, and the number of heads in the multi-head attention mechanism.

[0092] Furthermore, in step 3, the parallel-series hybrid feature deep learning network includes the following modules:

[0093] (1) Input layer module: Receives the dynamic word-level representation tensor generated by the DistilBERT model, whose dimension is (batch size, sequence length, embedding dimension); (2) Parallel channel module: The input layer module is connected to the upper and lower parallel channel modules, where the upper channel consists of a multi-scale one-dimensional convolution layer group, a maximum pooling layer corresponding to each convolution output, a feature dimension splicing layer and a global maximum pooling layer, and the lower channel consists of a bidirectional gated recurrent unit layer and a global maximum pooling layer; (3) Multi-head self-attention mechanism module: The outputs of the upper and lower channels are spliced ​​along the feature dimension, and the spliced ​​two-dimensional features are reshaped into three-dimensional features, and input into the multi-head self-attention mechanism for calculation; (4) Classification output module: The output results of the multi-head self-attention mechanism are sequentially passed through the random dropout layer, the flattening layer and the fully connected layer and then input into the classification output module to obtain the classification output results.

[0094] The experimental data comes from computer sales review data on an e-commerce platform. There are 5,000 review texts in total, which are divided into three sentiment categories: positive, neutral, and negative. In this embodiment, 60% of the total number of samples are selected as training samples, 20% as verification samples, and 20% as test samples.

[0095] The specific implementation process is as follows:

[0096] like Figure 1 , a product review sentiment analysis method based on MS-PSO and deep learning, including the following steps:

[0097] Step 1: Obtain the product review text and sentiment classification dataset required for training the model, and preprocess the product review text through the preprocessing module, where the text length stage value is 64;

[0098] Step 2: Encode the preprocessed product reviews using the lightweight DistilBERT model, extract the contextual hidden states of all sub-word tokens as dynamic word-level representation tensors with a shape of (64, 5000, 768), and convert the sentiment classification labels into integer encodings.

[0099] Step 3: Set the parameters required for the random mirror particle swarm algorithm: c1=c2=1.5, and the hyperparameters to be optimized for the parallel-series mixed feature deep learning network include the number of filters in the multi-scale convolution layer (where the number of multi-scales is 3 and the convolution kernel sizes are 3, 4, and 5 respectively), the learning rate, the random dropout rate, the L2 regularization strength, the number of units in the long short-term memory layer, and the number of heads in the multi-head attention mechanism. The lower limit of the optimization is lb=[32,1e-5,0.1,1e-5,16,2], and the upper limit of the optimization is ub=[128,1e-2,0.4,1e-3,128,8]. The calculation process of the random mirror particle swarm algorithm is as follows: Figure 2 shown.

[0100] Step 4: Optimize and connect the hyperparameters of the hybrid feature deep learning network through random mirror particle swarm algorithm, and connect the hybrid feature deep learning network structure in series. Figure 3 As shown;

[0101] Step 5: Based on the optimized hyperparameters, train and concatenate the hybrid feature deep learning network model;

[0102] Step 6: Obtain product reviews to be sentimentally classified, preprocess them through the preprocessing module, encode them through the DistilBERT model, extract the dynamic word-level representation tensor, and input them into the trained parallel-serial hybrid feature deep learning network model to obtain sentiment classification.

[0103] To verify the advantages of the proposed method, after preprocessing the review text, obtaining dynamic word-level representation tensors using DistilBERT, and integer encoding the sentiment classification, we used a multi-scale convolutional neural network (CNN, Model I), a bidirectional gated recurrent unit neural network (BiGRU, Model II), a multi-scale convolutional-bidirectional gated recurrent unit neural network (CNN-BiGRU, Model III), a bidirectional gated recurrent unit-multiscale convolutional neural network (BiGRU-CNN, Model IV), a multi-scale convolutional-bidirectional gated recurrent unit-multi-head self-attention neural network (CNN-BiGRU-MHSA, Model V), a bidirectional gated recurrent unit-multi-scale convolutional-multi-head self-attention neural network (BiGRU-CNN-MHSA, Model VI), and the proposed method (Model VII) for evaluation. All models were optimized using the MS-PSO method. To avoid randomness, each model was evaluated 20 times, and the average accuracy, precision, recall, and F1 score of each model were calculated. The evaluation results are shown in Table 1. At the same time, the calculation results of each model under 20 independent runs were statistically analyzed using box plots. Taking the accuracy index as an example, Figure 4 shown.

[0104] Table 1 Comparison of evaluation indicators of each model (%)

[0105] Model Accuracy Accuracy Recall F1 value Ⅰ 84.02 81.03 76.57 78.40 Ⅱ 85.53 82.45 78.83 80.38 Ⅲ 86.90 82.65 81.26 81.82 Ⅳ 85.95 82.96 79.38 80.85 Ⅴ 87.08 84.58 81.58 82.63 Ⅵ 88.77 86.27 82.68 84.25 Ⅶ 88.96 86.35 84.06 85.07

[0106] Table 1 and Figure 4 As can be seen, the proposed model (Model VII) demonstrates significant advantages over the comparison models. First, the median accuracy of Model VII reaches 88.96%, significantly higher than that of the comparison models I to V. Second, compared to Model VI, which has the closest accuracy, Model VII has significantly smaller bin areas and normal data distributions. Third, across 20 independent experiments, Model VII exhibited no outliers (denoted by the "+" symbol in the figure). In summary, the proposed model maintains optimal classification performance while exhibiting strong anti-interference capabilities and repeatability, fully demonstrating the advantages and stability of the proposed model.

[0107] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A product review sentiment analysis method based on MS-PSO and deep learning, characterized by: The following steps are involved: Step 1: Obtain the product review text and sentiment classification dataset required for training the model, and preprocess the product review text through the preprocessing module; Step 2: Encode the preprocessed product reviews using a lightweight DistilBERT model, extract the contextual hidden states of all subword tokens as dynamic word-level representation tensors, and convert the sentiment classification labels into integer encodings. Step 3: Set the parameters required by the random mirror particle swarm algorithm and the optimization range of the hyperparameters to be optimized of the series hybrid feature deep learning network; The random mirror particle swarm algorithm is an improved algorithm in the particle swarm optimization algorithm, and its steps include: (1) Particle initialization Similar to the particle swarm optimization algorithm, the initial particles are generated by random initialization: X i =lb+(ub-lb)×rand(1,dim) Where i is the particle number, X i represents the position of the i-th particle, lb is the lower limit of the optimization range, ub is the upper limit of the optimization range, rand(1,dim) represents a dim-dimensional vector composed of random numbers between 0 and 1, and dim is the dimension of the solution domain; After generating the initial particles, calculate the fitness values ​​of all particles; (2) Particle Update In each round of iteration, a random number R between 0 and 1 is generated for each particle i. i , and according to R i The value selection is direct update or mirror update: Case 1: When R i ≥0.5, the particle is directly updated, and the direct update method is: V i =(1-t / T)V i / 2+c1r1(P i -X i )+c2r2(G-X i ) X i =X i +V i Among them, V i represents the speed of particle i, t represents the current number of iterations, T represents the maximum number of iterations, c1 is the individual optimal item learning factor, c2 is the global optimal item learning factor; r1 is a random number between 0 and 1, r2 is a random number between 0 and 1, P i represents the optimal position of particle i in the search history, and G represents the position of the global optimal solution; Case 2: When R i <0.5, the particle is updated as a mirror image, which is divided into 3 sub-steps: Sub-step 1: Generate a mirror particle of particle i with G as the center, and the position is X m,i Represented, and the original particle i is deleted: PE=0.1×(rand(1,dim)-0.5)×(ub-lb) X m,i =2×G-X i +PE×(1-t / T) Among them, PE is the random disturbance; Sub-step 2: Determine whether the mirror particle exceeds the optimization range in each dimension. If it exceeds the optimization range in the jth dimension, correct the position of dimension j: X m,i,j = ub j + R i × (ub j - X m,i,j ) If X m,i,j > ub j X m,i,j = lb j + R i × (lb j - X m,i,j ) If X m,i,j <lb j where X m,i,j is the corrected mirror image position of the i-th particle in the j-th dimension, j = 1, 2, ..., M; ub j and lb j Respectively represent the upper and lower limits of the optimization range in the jth dimension; Sub-step 3: Update the particle position and velocity based on the mirror image: X i =X m,i +rand(1,dim)×(G-X m,i ) V i =0 (3) Particle elimination Recalculate the fitness values ​​of all particles and update P i and G, delete the particle with the worst fitness value and generate a new particle in the solution domain by random initialization; Finally, determine whether the termination condition is met. If not, repeat steps (2) to (3) until the iteration termination condition is met. If so, output the global optimal position and optimal solution. Step 4: Optimize and concatenate the hyperparameters of the hybrid feature deep learning network using random mirror particle swarm optimization; Step 5: Based on the optimized hyperparameters, train and concatenate the hybrid feature deep learning network model; Step 6: Obtain product reviews to be sentimentally classified, preprocess them through the preprocessing module, encode them through the DistilBERT model, extract the dynamic word-level representation tensor, and input them into the trained parallel-serial hybrid feature deep learning network model to obtain sentiment classification.

2. The product review sentiment analysis method based on MS-PSO and deep learning according to claim 1, characterized in that: In step one, the preprocessing module includes text cleaning, text length truncation, stop word removal, word segmentation, and product feature word unification; wherein, the product feature word unification is the feature vocabulary for product brands, models, component names and performance parameters, which are standardized into preset unified vocabulary based on a synonym dictionary.

3. The product review sentiment analysis method based on MS-PSO and deep learning as claimed in claim 1, characterized in that: In step three, the parameters required for the random mirror particle swarm algorithm include the individual optimal learning factor c1 and the global optimal learning factor c2; the hyperparameters to be optimized of the parallel-series hybrid feature deep learning network include the number of filters of the multi-scale convolutional layer, the learning rate, the random dropout rate, the L2 regularization strength, the number of units in the long short-term memory layer, and the number of heads in the multi-head attention mechanism.

4. The product review sentiment analysis method based on MS-PSO and deep learning according to claim 1, characterized in that: In step 3, the parallel-series hybrid feature deep learning network includes the following modules: (1) Input layer module: Receives the dynamic word-level representation tensor generated by the DistilBERT model; (2) Parallel channel module: The input layer module is connected to the upper and lower parallel channel modules, where the upper channel consists of a multi-scale one-dimensional convolution layer group, a maximum pooling layer corresponding to each convolution output, a feature dimension splicing layer and a global maximum pooling layer, and the lower channel consists of a bidirectional gated recurrent unit layer and a global maximum pooling layer; (3) Multi-head self-attention mechanism module: The outputs of the upper and lower channels are spliced ​​along the feature dimension, and the spliced ​​two-dimensional features are reshaped into three-dimensional features, and input into the multi-head self-attention mechanism for calculation; (4) Classification output module: The output results of the multi-head self-attention mechanism are sequentially passed through the random dropout layer, the flattening layer and the fully connected layer and then input into the classification output module to obtain the classification output results.

Citation Information

Patent Citations

  • Chinese comment text sentiment analysis method, system and equipment and storage medium

    CN118095289A

  • Dynamic landslide displacement real-time prediction method based on PFA-GRU-OL-MRT

    CN119989850A