Chinese comment sentiment analysis method of BERT-MO-CNN-BILSTM
By combining BERT, multi-scale convolutional neural network and bidirectional long and short-term memory neural network, and combining mining optimization algorithms to optimize hyperparameters, the problem of insufficient efficiency of feature extraction and optimization algorithms in traditional text sentiment analysis methods is solved, and better emotional classification effects are achieved.
Patent Information
- Application Number
- CN202510215540.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-26
AI Technical Summary
Traditional text sentiment analysis methods have problems such as inaccurate semantic representation of static word vectors, insufficient ability to extract features of a single model and a single scale, and insufficient efficiency and accuracy of optimization algorithms, resulting in poor emotional classification results.
The Chinese comment sentiment analysis method of BERT-MO-CNN-BILSTM is used to generate dynamic word vectors through ChineseBERT, and multi-scale convolutional neural networks and bidirectional long and short-term memory neural networks are combined to extract multi-scale and global features, and the model hyperparameters are optimized using mining optimization algorithm (MO) to improve the accuracy of emotion classification.
It improves the accuracy and efficiency of emotion classification, solves the problems of insufficient feature extraction and insufficient efficiency of optimization algorithms in traditional methods, and provides better emotion classification effects.
Smart Images

Figure CN119721053A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text sentiment analysis, and in particular to a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method. Background Art
[0002] Text sentiment analysis is the computational study of the opinions and emotions expressed in text. As e-commerce models mature and online shopping continues to expand, the number of online reviews by consumers after purchasing products is also increasing. The rich emotional information contained in these reviews will not only become an important basis for potential consumers to judge the quality of products, but will also help manufacturers to fully understand user needs and improve their products. Therefore, the study of online review text sentiment analysis has important practical significance.
[0003] Compared with ordinary text, online comments have the problems of small vocabulary and sparse features, which puts higher requirements on the representation of text semantic features. In recent years, with the development of machine learning methods, deep learning technology has been widely used in the field of text sentiment analysis. However, a single deep learning module has problems such as insufficient feature extraction, inaccurate semantic representation and low prediction accuracy. Therefore, many researchers mix different deep learning models, especially neural network models, to improve model performance. At the same time, the performance of neural network models will be affected by hyperparameters. Inappropriate hyperparameters may directly lead to diagnostic errors and affect diagnostic accuracy. Therefore, optimizing neural networks based on optimization algorithms and finding the optimal match of hyperparameters has also become a hot topic in current research. However, the existing intelligent optimization algorithms still have room for further improvement in optimization accuracy and computational efficiency. Especially for the optimization of complex neural network models, finding the local optimum in a limited time is often more practical than finding the global optimum. Summary of the invention
[0004] The purpose of the present invention is to provide a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method, which can solve the problems of inaccurate semantic representation of static word vectors in traditional methods, insufficient feature extraction capabilities of single models and single scales, and insufficient efficiency and precision of traditional optimization algorithms. It can make the model have better sentiment classification effect and provide reliable technical support for improving the sentiment classification effect of online reviews.
[0005] The present invention is achieved in that: The technical solution to achieve the purpose of the present invention is: a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method, comprising the following steps: Step 1: Obtain Chinese review text and sentiment classification, and preprocess the Chinese review text, including text cleaning, stop word removal, and word segmentation; Step 2: Convert the preprocessed text into a word embedding matrix through ChineseBERT, and convert the sentiment classification into a one-hot encoding; Step 3: Set the parameters required for the Mine Optimization Algorithm (MO); Step 4: Determine the network structure of the multi-scale convolutional concatenated bidirectional long short-term memory neural network, and optimize the hyperparameters of the multi-scale convolutional concatenated bidirectional long short-term memory neural network (CNN-BILSTM) through 6 stages of the mine optimization algorithm; Step 5: Input the word embedding matrix into the neural network model with optimized hyperparameters, and train to obtain a Chinese review text sentiment analysis model based on BERT-MO-CNN-BILSTM; Step 6: Preprocess the text data to be sentiment classified, generate a word embedding matrix through ChineseBERT, and then input it into the trained Chinese text review sentiment analysis model to obtain the sentiment classification.
[0006] Further, in Step 3, the parameters required for the Mine Optimization Algorithm (MO) include the number of mines K, the proportion of high-quality mines Kp, where 0 < Kp < 1, the mining point base Ma, the mining center search range factor Tp, where 0 < Tp < 0.2, the maximum moving step ratio Dt, where 0.01 < Dt < 0.2, and the maximum number of iterations T.
[0007] Further, in Step 4, the mine optimization algorithm includes 6 stages: (1) Mine initialization stage, randomly generate K mines within the solution domain, each mine has a mining center, and the initial value of the mining center position of the mine K i The expression is: K i =lb+ (ub - lb) × rand (0, 1) where, K i represents the position of the i th mine's mining center, i i = 1, 2, …, K, lb is the lower limit of the search domain in each dimension, ub is the upper limit of the search domain in each dimension, K i , lb, and ub are all N-dimensional vectors, where N represents the dimension of the problem to be solved, rand (0, 1) represents an N-dimensional vector composed of random numbers between 0 and 1; (2) Select high-quality mines stage, calculate the fitness values of the mining centers of K mines, and select the E mines with the best fitness values of the mining centers as high-quality mines: E = round(K×Kp) Among them, E is the number of high-quality mines; Kp is the proportion of high-quality mines; the round() function represents rounding the value in the brackets to an integer; (3) Mining stage: for E high-quality mines, different numbers of mining points are randomly generated within the mining center search range factor Tp around the mining center of each mine. The search range is range Decreases as the number of iterations increases: range =Tp×(ub-lb)×(1- t / T) in, t is the number of current iterations, T is the maximum number of iterations; The number of mining points is related to the fitness value ranking and iteration number of the high-quality mine mining center. The number of mining points generated around each high-quality mine mining center can be expressed as: S a = round (Ma× ( E -a +1)×(1- t / T)) in, S a For the a The number of mining nodes generated around high-quality mines, a The ranking of the fitness values of high-quality mines. The lower the fitness value, the higher the ranking. ,a =1,2,…,E, Ma is the base number of mining points; The location of each mining point generated is: K aj = KA a +range ×( 2 × rand (0,1)-1) in, K aj Representative a The first generation of high-quality mining centers around j The location of the mining site, j=1,2,…, S a , KA a For the a The location of a high-quality mining center, K aj and KA a are all N-dimensional vectors; (4) Mining group evaluation stage: First, for E high-quality mines, the mining center of the high-quality mine and the mining points generated by the high-quality mine are combined into a mining group. For non-high-quality mines, the mining group is composed of the mining center of the mine itself; Secondly, calculate the fitness value of each mining point in each mining group, and combine the fitness value of the mining center of each mining group to obtain the average fitness value of each mining group FT i and the average position KS i ,Right now:
[0008]
[0009] in, F() is the fitness function; The average fitness value FT i The optimal mining group is defined as the optimal mining group, and the average fitness value FT i The worst and second worst mining groups are defined as the worst mining group and second worst mining group; Again, by comparing the fitness values, we can get the optimal fitness value among all mining centers and mining points. FKD min And the corresponding position, the worst fitness value FKD max , the average fitness value of the best position and suboptimal position in the optimal mining group and the worst mining group FT max 、 The optimal fitness value in each mining group ( FKT min ) i and its location ; (5) During the prospecting phase, the mining center conducts prospecting in the following steps: The mining center location of each mine K i , is changed to the optimal fitness value in the mining group where the mining center is located ( FKT min ) i Location; For the optimal mining group, and the global optimal fitness value FKD min The mining group where it is located will no longer conduct prospecting, that is, the location of its mining center will remain unchanged; For non-optimal mining groups and non-globally optimal fitness values FKD minThe mining group in which the mining group is located selects a high-quality mine mining center as the target according to probability, and conducts prospecting from the mining center of the mining group to the mining center of the high-quality mine. The probability of a high-quality mine being selected is related to the fitness value of its mining center, and the probability can be expressed as:
[0010] in R (a) represents the probability of the a-th high-quality mine being selected, ( FKT min ) a Represents the optimal fitness value of the a-th high-quality mine mining group, and the moving distance of the mining center D i It is related to the fitness value and the number of iterations. i The mining centers selected a A high-quality mine D i It can be expressed as: D i =D t ×(ub-lb)× F ia × T ia ×( K a -K i ) Among them, D t is the maximum moving step ratio, F ia is the fitness value influencing term, T ia are the influencing terms of the number of iterations, which are: F ia = (( FKT min ) i - ( FKT min ) a ) / ( FKD max -FKD min ) T ia = 1- e (-rand(0,1)×t / tmax) Then the initial position of the mining center in the next iteration will be updated to: K it+1 =K i t +D i t The superscript represents the number of iterations; (6) In the human resource deployment stage, the mining personnel will be deployed for the worst mining group and the second-worst mining group. For the worst mining group, its mining center will be deployed to the second-best position in the best mining group; for the second-worst mining group, the original mining center will be deleted, and a point will be randomly generated in the solution domain as the new mining center. The random generation method is consistent with the mine initialization method. Delete all mining points and determine whether the iteration is over. If the iteration is over, output the optimal parameters. If the iteration is not over, return to stage (2) and repeat the calculation of stages (2) to (6).
[0011] Furthermore, in step 4, the multi-scale convolutional bidirectional long short-term memory neural network includes an input layer, a multi-scale convolutional layer and a pooling layer, a merging layer, a BILSTM layer, a fully connected layer and an output layer; wherein the multi-scale convolutional layer and the pooling layer perform convolution and pooling operations on convolution kernels of different sizes respectively and then merge them, and input the merged results into the BILSTM layer.
[0012] Furthermore, in step 4, the hyperparameters include the number of filters in the convolutional layer, the multi-scale convolution kernel size, the number of hidden units in the BILSTM, the round size, and the training batch size.
[0013] The beneficial effect of the present invention is that the present invention provides a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method. Among them, the Chinese version of BERT, ChineseBERT, can obtain the dynamic word vector of the text, the multi-scale convolutional neural network (CNN) can obtain local information of different scales through convolution kernels of different sizes, the long short-term memory neural network (BILSTM) can fully explore the global and temporal information, and the mining optimization algorithm (Mining optimization, MO) is a new type of meta-heuristic optimization algorithm originally proposed by the present invention. By optimizing the hyperparameters of the model through the MO algorithm, the model can have a better classification effect, providing reliable technical support for improving the sentiment classification effect of online reviews. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0015] Figure 1 It is a flowchart of a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method provided by an embodiment of the present invention; Figure 2 is a detailed flow chart of the MO optimization algorithm provided by an embodiment of the present invention; Figure 3 It is a graph showing how the fitness values of different optimization algorithms provided by the embodiments of the present invention vary with the number of iterations. DETAILED DESCRIPTION
[0016] 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 belong to 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 claimed for protection, but merely represents the 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 belong to the scope of protection of the present invention.
[0017] The method of the present invention is described below by taking a specific Chinese review sentiment analysis case as an example.
[0018] like Figure 1 , a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method, including the following steps: Step 1: Obtain Chinese review text and sentiment classification, and preprocess the Chinese review text, including text cleaning, stop word removal, and word segmentation; Step 2: Convert the preprocessed text into a word embedding matrix through ChineseBERT, and convert the sentiment classification into one-hot encoding; Step 3: Set the parameters required for the mining optimization algorithm (MO); Step 4: Determine the network structure of the multi-scale convolutional concatenated bidirectional long short-term memory neural network, and optimize the hyperparameters of the multi-scale convolutional concatenated bidirectional long short-term memory neural network (CNN-BILSTM) through the 6 stages of the mine exploitation optimization algorithm; Step 5: Input the word embedding matrix into the neural network model with optimized hyperparameters, and train to obtain a Chinese review text sentiment analysis model based on BERT-MO-CNN-BILSTM; Step 6: Preprocess the text data to be sentiment classified, generate a word embedding matrix through ChineseBERT, and then input it into the trained Chinese text review sentiment analysis model to obtain sentiment classification.
[0019] Furthermore, in Step 3, the parameters required for the mine exploitation optimization algorithm (MO) include the number of mines K, the high-quality mine ratio Kp, where 0 < Kp < 1, the exploitation point base Ma, the exploitation center search range factor Tp, where 0 < Tp < 0.2, the maximum moving step ratio Dt, where 0.01 < Dt < 0.2, and the maximum number of iterations T.
[0020] Furthermore, in Step 4, the mine exploitation optimization algorithm includes 6 stages: (1) Mine initialization stage, randomly generate K mines within the solution domain, each mine has an exploitation center, and the initial value of the mine exploitation center position K i The expression is: K i =lb+ (ub - lb) × rand (0, 1) where, K i represents the position of the i th mine exploitation center, i i = 1, 2,..., K, lb is the lower limit of the search domain in each dimension, ub is the upper limit of the search domain in each dimension, K i , lb, and ub are all N-dimensional vectors, where N represents the dimension of the problem to be solved, rand (0, 1) represents an N-dimensional vector composed of random numbers between 0 and 1; (2) Select high-quality mines stage, calculate the fitness values of the exploitation centers of K mines, and select the E mines with the best fitness values of the exploitation centers as high-quality mines: E = round(K × Kp) where, E is the number of high-quality mines; Kp is the high-quality mine ratio; the round() function represents rounding the value in the parentheses to an integer; (3) Mining stage: for E high-quality mines, different numbers of mining points are randomly generated within the mining center search range factor Tp around the mining center of each mine. The search range is range Decreases as the number of iterations increases: range =Tp×(ub-lb)×(1- t / T) in, t is the number of current iterations, T is the maximum number of iterations; range It decreases with the increase of the number of iterations, which can make the local exploration ability stronger in the early stage of the search and the local convergence ability stronger in the later stage of the search; The number of mining points is related to the fitness value ranking and iteration number of the high-quality mine mining center. The number of mining points generated around each high-quality mine mining center can be expressed as: S a = round (Ma× ( E -a +1)×(1- t / T)) in, S a For the a The number of mining nodes generated around high-quality mines, a The ranking of the fitness values of high-quality mines. The lower the fitness value, the higher the ranking. ,a =1,2,…,E, Ma is the base number of mining points; S a The expression shows that , The more mining points are generated around the high-quality mines with better fitness values, the more conducive it is to finding the local or global optimal solution; The location of each mining point generated is: K aj = KA a +range ×( 2 × rand (0,1)-1) in, K aj Representative a The first generation of high-quality mining centers around j The location of the mining site, j=1,2,…, S a , KA a For the a The location of a high-quality mining center, Kaj and KA a are all N-dimensional vectors; (4) Mining group evaluation stage: First, for E high-quality mines, the mining center of the high-quality mine and the mining points generated by the high-quality mine are combined into a mining group. For non-high-quality mines, the mining group is composed of the mining center of the mine itself; Secondly, calculate the fitness value of each mining point in each mining group, and combine the fitness value of the mining center of each mining group to obtain the average fitness value of each mining group FT i and the average position KS i ,Right now:
[0021]
[0022] in, F() is the fitness function; The average fitness value FT i The optimal mining group is defined as the optimal mining group, and the average fitness value FT i The worst and second worst mining groups are defined as the worst mining group and second worst mining group; Again, by comparing the fitness values, we can get the optimal fitness value among all mining centers and mining points. FKD min And the corresponding position, the worst fitness value FKD max , the average fitness value of the best position and suboptimal position in the optimal mining group and the worst mining group FT max 、 The optimal fitness value in each mining group ( FKT min ) i and its location ; Through mining group evaluation, each mining center can quickly locate the optimal position for local search; (5) During the prospecting phase, the mining center conducts prospecting in the following steps: The mining center location of each mine K i , is changed to the optimal fitness value in the mining group where the mining center is located ( FKT min ) i Location; For the optimal mining group, and the global optimal fitness value FKD minThe mining group where it is located will no longer conduct prospecting, that is, the location of its mining center will remain unchanged; For non-optimal mining groups and non-globally optimal fitness values FKD min The mining group in which the mining group is located selects a high-quality mine mining center as the target according to probability, and conducts prospecting from the mining center of the mining group to the mining center of the high-quality mine. The probability of a high-quality mine being selected is related to the fitness value of its mining center, and the probability can be expressed as:
[0023] in R (a) represents the probability of the a-th high-quality mine being selected, ( FKT min ) a Represents the optimal fitness value of the a-th high-quality mine mining group, and the moving distance of the mining center D i It is related to the fitness value and the number of iterations. i The mining centers selected a A high-quality mine D i It can be expressed as: D i =D t ×(ub-lb)× F ia × T ia ×( K a -K i ) Among them, D t is the maximum moving step ratio, F ia is the fitness value influencing term, T ia are the influencing terms of the number of iterations, which are: F ia = (( FKT min ) i - ( FKT min ) a ) / ( FKD max -FKD min ) T ia = 1- e(-rand(0,1)×t / tmax) Then the initial position of the mining center in the next iteration will be updated to: K i t+1 =K i t +D i t The superscript represents the number of iterations; Through prospecting, the location of each mining center can be further optimized; (6) In the human resource deployment stage, the mining personnel will be deployed for the worst mining group and the second-worst mining group. For the worst mining group, its mining center will be deployed to the second-best position in the best mining group; for the second-worst mining group, the original mining center will be deleted, and a point will be randomly generated in the solution domain as the new mining center. The random generation method is consistent with the mine initialization method. Through human resource deployment, local search capabilities are strengthened while the ability to escape from local optimality is improved; Delete all mining points and determine whether the iteration is over. If the iteration is over, output the optimal parameters. If the iteration is not over, return to the key stage (2) and repeat the calculation of stages (2) to (6).
[0024] Furthermore, in step 4, the multi-scale convolutional bidirectional long short-term memory neural network includes an input layer, a multi-scale convolutional layer and a pooling layer, a merging layer, a BILSTM layer, a fully connected layer and an output layer; wherein the multi-scale convolutional layer and the pooling layer perform convolution and pooling operations on convolution kernels of different sizes respectively and then merge them, and input the merged results into the BILSTM layer.
[0025] Furthermore, in step 4, the hyperparameters include the number of filters in the convolutional layer, the multi-scale convolution kernel size, the number of hidden units in the BILSTM, the round size, and the training batch size.
[0026] The experimental data comes from computer sales review data on an e-commerce platform. There are 4,000 review texts in total, which are divided into two sentiment categories: positive and negative, with 2,000 comments in each category. In this embodiment, 70% of the total number of samples are selected as training samples, 10% as verification samples, and 20% as test samples.
[0027] The specific implementation process is as follows: like Figure 1 , a BERT-MO-CNN-BILSTM Chinese review sentiment analysis method, including the following steps: Step 1: Obtain Chinese review text and sentiment classification, and preprocess the Chinese review text, including text cleaning, stop word removal, and word segmentation; Step 2: Convert the preprocessed text into a word embedding matrix through ChineseBERT, and convert the sentiment classification into one-hot encoding; Step 3: Set the parameters required for the mining optimization algorithm (MO), including the number of mines K=5, the proportion of high-quality mines Kp=0.4, the base number of mining points Ma=2, the mining center search range factor Tp=0.1, the maximum moving step ratio Dt=0.05, and the maximum number of iterations T=10; Step 4: Determine the network structure of the multi-scale convolutional bidirectional long short-term memory neural network, which includes the input layer, multi-scale convolutional layer and pooling layer, merging layer, BILSTM layer, fully connected layer and output layer; optimize the hyperparameters of the multi-scale convolutional bidirectional long short-term memory neural network (CNN-BILSTM) through the six stages of the mining optimization algorithm. The mining optimization algorithm process is as follows: Figure 2 As shown in the figure, the upper limit of the number of filters in the hyperparameters, the number of hidden units in BILSTM, the size of multi-scale convolution kernels, the round size epoch, and the training batch size is lb=[16,16,3,4,5,3,16], and the lower limit is ub=[256,256,6,8,10,16,256]; Step 5: Input the word embedding matrix into the CNN-BILSTM model with optimized hyperparameters, and train the Chinese review text sentiment analysis model based on BERT-MO-CNN-BILSTM; Step 6: Preprocess the text data to be sentimentally classified, generate a word embedding matrix through ChineseBERT, and then input it into the trained Chinese text comment sentiment analysis model to obtain sentiment classification.
[0028] To verify the advantages of the method of the present invention, after preprocessing the comment text, generating word embedding matrix with ChineseBERT and unique-hot encoding for sentiment classification, the bidirectional long short-term memory neural network (BILSTM), multi-scale convolutional neural network (CNN), bidirectional long short-term memory neural network connected with multi-scale convolutional neural network (BILSTM-CNN), multi-scale convolutional neural network connected with bidirectional long short-term memory neural network (CNN-BILSTM), multi-scale convolutional neural network connected with bidirectional long short-term memory neural network (PLO-CNN-BILSTM) optimized by Aurora optimization algorithm, multi-scale convolutional neural network connected with bidirectional long short-term memory neural network (RIME-CNN-BILSTM) optimized by frost optimization algorithm and MO-CNN-BILSTM proposed by the present invention were used for calculation respectively, and the classification results of each method were evaluated by using accuracy, precision, recall rate and F1 value. The evaluation results are shown in Table 1. At the same time, taking the negative of accuracy as the fitness function, the convergence process of PLO, RIME and MO methods in optimizing the hyperparameters of CNN-BILSTM is shown in Figure 1. Figure 3 As shown in the figure, it can be seen that the MO-CNN-BILSTM method proposed in the present invention has achieved the best performance in all indicators, and its convergence process is better than that of the PLO and RIME optimization algorithms.
[0029] Table 1 Comparison of evaluation indicators of various models
[0030] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A BERT-MO-CNN-BILSTM Chinese review sentiment analysis method, characterized in that: It includes the following steps: Step 1: Obtain Chinese review texts and their sentiment classifications, and preprocess the Chinese review texts, including text cleaning, stop word removal, and word segmentation; Step 2: Convert the preprocessed text into a word embedding matrix through ChineseBERT, and convert the sentiment classification into a one-hot encoding; Step 3: Set the parameters required for the mine exploitation optimization algorithm; Step 4: Determine the network structure of the multi-scale convolutional cascaded bidirectional long short-term memory neural network, and optimize the hyperparameters of the multi-scale convolutional cascaded bidirectional long short-term memory neural network through 6 stages of the mine exploitation optimization algorithm; Step 5: Input the word embedding matrix into the neural network model with optimized hyperparameters, and train to obtain a Chinese review text sentiment analysis model based on BERT-MO-CNN-BILSTM; Step 6: Preprocess the text data to be sentiment classified, generate a word embedding matrix through ChineseBERT, and then input it into the trained Chinese text review sentiment analysis model to obtain the sentiment classification.
2. The Chinese review sentiment analysis method of BERT-MO-CNN-BILSTM as claimed in claim 1, characterized in that: In Step 3, the parameters required for the mine exploitation optimization algorithm include the number of mines K, the high-quality mine ratio Kp, where 0 < Kp < 1, the mining point base Ma, the mining center search range factor Tp, where 0 < Tp < 0.2, the maximum moving step ratio Dt, where 0.01 < Dt < 0.2, and the maximum number of iterations T.
3. The Chinese review sentiment analysis method of BERT-MO-CNN-BILSTM as claimed in claim 1, characterized in that: In Step 4, the mine exploitation optimization algorithm includes 6 stages: (1) In the mine initialization phase, K mines are randomly generated in the solution domain. Each mine has a mining center. The initial value of the mining center position is K i The expression is: K i =lb+ (ub-lb)× rand (0,1) K i Representative i The location of the mining center, i =1,2,…,K, lb is the lower limit of the search domain in each dimension, ub is the upper limit of the search domain in each dimension, K i , lb, ub are all N-dimensional vectors, where N represents the dimension of the problem to be solved. rand (0,1) represents an N-dimensional vector composed of random numbers between 0 and 1; (2) The stage of selecting high-quality mines: Calculate the fitness values of the mining centers of K mines, and select the E mines with the optimal fitness values of the mining centers as high-quality mines: E = round(K × Kp) where E is the number of high-quality mines; Kp is the high-quality mine ratio; the round() function represents rounding the value in the parentheses to an integer; (3) Mining stage: for E high-quality mines, different numbers of mining points are randomly generated within the mining center search range factor Tp around the mining center of each mine. The search range is range Decreases as the number of iterations increases: range =Tp×(ub-lb)×(1- t / T) in, t is the number of current iterations, T is the maximum number of iterations; The number of mining points is related to the fitness value ranking of the high-quality mine mining centers and the number of iterations. The number of mining points generated around each high-quality mine mining center is expressed as: S a = round (Ma× ( E -a +1)×(1- t / T)) in, S a For the a The number of mining nodes generated around high-quality mines, a The ranking of the fitness values of high-quality mines. The lower the fitness value, the higher the ranking. ,a =1,2,…,E, Ma is the base number of mining points; Then the position of each generated mining point is: K aj = KA a +range ×( 2 × rand (0,1)-1) in, K aj Representative a The first generation of high-quality mining centers around j The location of the mining site, j = 1, 2, …, S a , KA a For the a The location of a high-quality mining center, K aj and KA a are all N-dimensional vectors; (4) The stage of comparing mining groups: First, for the E high-quality mines, form a mining group by combining the mining center of the high-quality mine with the mining points generated by the high-quality mine. For non-high-quality mines, the mining group consists of the mining center of the mine itself; Secondly, calculate the fitness value of each mining point in each mining group, and combine the fitness value of the mining center of each mining group to obtain the average fitness value of each mining group FT i and the average position KS i ,Right now: in, F() is the fitness function; The average fitness value FT i The optimal mining group is defined as the optimal mining group, and the average fitness value FT i The worst and second worst mining groups are defined as the worst mining group and second worst mining group; Again, by comparing the fitness values, we can get the optimal fitness value among all mining centers and mining points. FKD min And the corresponding position, the worst fitness value FKD max , the average fitness value of the best position and suboptimal position in the optimal mining group and the worst mining group FT max 、 The optimal fitness value in each mining group ( FKT min ) i and its location ; (5) The prospecting stage: The mining center prospecting is carried out according to the following steps: The mining center location of each mine K i , is changed to the optimal fitness value in the mining group where the mining center is located ( FKT min ) i Location; For the optimal mining group, and the global optimal fitness value FKD min The mining group where it is located will no longer conduct prospecting, that is, the location of its mining center will remain unchanged; For non-optimal mining groups and non-globally optimal fitness values FKD min The mining group in which the mining group is located selects a high-quality mine mining center as the target according to probability, and conducts prospecting from the mining center of the mining group to the mining center of the high-quality mine. The probability of a high-quality mine being selected is related to the fitness value of its mining center, and the probability is expressed as: in R (a) represents the probability of the a-th high-quality mine being selected, ( FKT min ) a Represents the optimal fitness value of the a-th high-quality mine mining group, and the moving distance of the mining center D i It is related to the fitness value and the number of iterations. i The mining centers selected a A high-quality mine D i It is expressed as: D i =D t ×(ub-lb)× F ia × T ia ×( K a -K i ) Among them, D t is the maximum moving step ratio, F ia is the fitness value influencing term, T ia are the influencing terms of the number of iterations, which are: F ia = (( FKT min ) i - ( FKT min ) a ) / ( FKD max -FKD min ) T ia = 1- e (-rand(0,1)×t / tmax) Then the initial position of the mining center in the next iteration will be updated to: K i t+1 =K i t +D i t where the superscript represents the number of iterations; (6) The human resource allocation stage: For the worst mining group and the second-worst mining group, the mining personnel will be allocated. Among them, for the worst mining group, its mining center will be allocated to the sub-optimal position in the optimal mining group; for the second-worst mining group, the original mining center will be deleted, and a point will be randomly generated within the solution domain as the new mining center. The random generation method is the same as the mine initialization method; Delete all mining points and determine whether the iteration is over. If the iteration is over, output the optimal parameters. If the iteration is not over, return to stage (2) and repeat the calculation of stages (2) to (6).
4. The Chinese review sentiment analysis method of a BERT-MO-CNN-BILSTM as claimed in claim 1, characterized in that: In step 4, the multi-scale convolutional bidirectional long short-term memory neural network includes an input layer, a multi-scale convolutional layer and a pooling layer, a merging layer, a BILSTM layer, a fully connected layer and an output layer; wherein the multi-scale convolutional layer and the pooling layer perform convolution and pooling operations on convolution kernels of different sizes respectively and then merge them, and input the merged results into the BILSTM layer.
5. The Chinese review sentiment analysis method of BERT-MO-CNN-BILSTM as claimed in claim 1, characterized in that: In step 4, the hyperparameters include the number of filters in the convolutional layer, the multi-scale convolution kernel size, the number of hidden units in the BILSTM, the round size, and the training batch size.
Citation Information
Patent Citations
Text sentiment analysis method for optimizing regularization extreme learning machine based on particle swarm optimization
CN114880465A
Cited By
Intelligent battery SOH real-time prediction method
CN120011817A
MS-PSO and deep learning-based product comment sentiment analysis method
CN120234678A