# Short Text Aspect-Based Sentiment Analysis Based on CNN + BiGRU
## 3 Construction of CNN + BiGRU
### CNN + BiGRU Experimental Model Construction  
The model designed in this study is based on a CNN and BiGRU network and is divided into six levels: input layer, convolution layer, pooling layer, BiGRU network layer, fully connected layer, and output layer. The structure of the BiGRU network layer is shown in Figure 2 below. Input layer: this layer is responsible for data preprocessing and word vector training. (1) Data preprocessing. This layer performs deduplication, data cleaning, and word segmentation on the input comment sentences, and combines continuous character sequences into word sequences according to certain specifications through a series of processing steps. (2) Word vector training. The input layer uses one-hot technology to convert the result of word segmentation into word vector form. Assuming the dimension of the word vector is N, the input vector of a comment text of length n after one-hot encoding can be expressed as follows:  
\[X_{1:n}=X_{1}\oplus X_{2}\oplus\ldots\oplus X_{n} \tag{6}\]  
where \(X_{n}\) is the word vector of the nth word, \(\oplus\) is the concatenation operator, and \(X_{1:n}\) represents the feature vector composed of word vectors of the words \(X_{1}\)-\(X_{n}\). The output word vector output after one-hot encoding can be expressed as follows:  
\[W_{1:n}=X_{1:n}\cdot\mathrm{P} \tag{7}\]  
Figure 1: BIGRU Network Structure. Figure 2: CNN + BiGRU Network Structure. where P represents the weight of the feature value of the input vector and W\({}_{1:n}\) is the output word vector (that is, the result of multiplying the input vector and the weight matrix). (3) Data vector transfer. By using a three-layer neural network to transform language into a spatial vector form, natural language is transformed into a machine-recognizable spatial vector. Convolution processing: This layer passes the word vector set to the original sentence convolution layer for training. Feature extraction of the input text is completed through the set filter. We use a convolution kernel with dimensions h \(\times\) k to perform convolution operations, where h is the height of the convolution kernel and n is the dimension of the word vector. In order to capture as much context information as possible, multiple sets of convolution kernels with different heights are generally set for operation, but as the convolution kernels increase, the training efficiency will decrease accordingly. Therefore, in the model training part, the sizes of the convolution windows were set to 2, 3, 4, and 5 respectively; the number of convolution kernels was set to 100. The calculation formula is as follows:  
\[C_{hi}=f\ (\ W_{h}X_{ii+h-1}+\ b),\ h=2,3,4,5 \tag{8}\]  
where \(C_{hi}\) represents the generated feature sequence, \(W_{h}\) represents the weight matrix of different convolution kernels, \(b\) represents the bias vector, and \(X_{ii+h-1}\) represents the word vector matrix from \(i\) to \(i+h-1\) in the sentence matrix. \(f\) represents the activation function, and the feature set is obtained after calculation:  
\[C_{1}=C_{1}\oplus C_{2}\oplus\ldots\oplus C_{i+h-1} \tag{9}\]  
Pooling layer: this layer samples the features obtained from the convolution layer and obtains the optimal solution of local values so as to realize the secondary screening of features and output the feature matrix with a fixed size to reduce the dimension of the results. The calculation of the convolution layer uses convolution kernels of different sizes, which will lead to inconsistency of the vector dimensions, and the maximum value of each vector can generally be considered the most important feature of the vector, so the method of maximum pooling was adopted to carry out the calculation of the pooling layer. The calculation formula for the feature vector graph after maximum pooling of different convolution kernels is as follows:  
\[C_{pool}=\text{Max}(C_{1},C_{2},\ldots,C_{n-h+1}),\ h=2,3,4,5 \tag{10}\]  
BiGRU network layer: BiGRU layer is mainly composed of input, forward GRU, reverse GRU, and forward GRU output [8].