# An Analysis Method for Interpretability of CNN Text Classification Model
## 4 Experimental Design and Result Analysis
### Experiment Design  
(A) CNN text classification model  
Based on the CNN model, this paper suggests combining word embedding with it, so that the performance of the CNN on sentiment text classification tasks can be optimized. The specific CNN text classification model is designed as follows: find the word embedding of each word appearing in each sample in the word vector list trained by the Skip-gram model, and combine it into an m*k two-dimensional matrix as the input of CNN. Where, m is the number of words contained in each comment in the data set, and k is the length of word embedding. In this experiment, m is uniformly controlled to 500 words, and 128 is selected as the length of each word embedding. The representation of CNN learning is more suitable for the visual, and dealing with non-time series problems consumes fewer resources. At the same time, in the experiments we found that for text within 50 words a convolution pooling layer can be set, and within 500 words of text two convolution pooling layer can be used, so according to the demand of the actual data, the CNN model uses two convolutional pooling layers. The convolutional pooling layer is followed by a densely connected layer. As the convolutional layer in the model uses multiple convolution kernels, sufficient local features are extracted, and the accuracy of the experimental model reaches 89%. Therefore, before the classification layer of the model, in order to reduce the parameters of the model, we use the global max-pooling method. The structure of the convolutional neural network in the model is shown in Figure 6, and the binary classification was used as the output of the final model. Figure 5: Data set Word Frequency Dictionary (part). The CNN text classification model was iterated for 30 rounds, as shown in Figure 7; the horizontal axis represents the number of iterations, the vertical axis represents the accuracy in the left figure, and the vertical axis represents the loss in the right figure. For training and testing the process model accuracy and loss of the function curve, we conducted the test ten times. Through the test we can see from the picture that when the model is the eighth round of iteration the model is in the best condition, when the number of iterations is more than 10 rounds, model validation set loss gradually increased as a result, so we suggest the model number of iterations in round 8 for the best control. One of the fundamental problems in machine learning is the contradiction between optimization and generalization. In this paper, multi-round iteration is used to train the model. In order to prevent the overfitting of the model, the optimal iteration times of the model can be determined. In the experiment, after 30 rounds of training, we found that the model began to overfitting after 8-10 rounds, and then set the number of iterations to 8 to retrain the model. Since the accuracy of the model affects the interpretability of the model, the prediction results obtained by using the model with the required accuracy are more meaningful, thus the interpretability and visualization results obtained by model backtracking analysis are meaningful. In the process of model training, the above methods are used to adjust the model to prevent overfitting. (B) Backtracking analysis model  
Figure 6: Structure diagram of convolutional neural network. Figure 7: Structure diagram of convolutional neural network. After calculation of the CNN text classification model, we obtained the category label of the current text. There were two types of labels in the experiment (positive evaluation and negative evaluation). According to the backtracking analysis method mentioned above, we first obtained the category labels output by the CNN text classification model, performed backtracking analysis on the key parts of the text that affected the model's prediction results through deconvolution and depooling operations, and provided a basic data source for the subsequent visual analysis of experimental results.