# A Domain-Independent Classification Model for Sentiment Analysis Using Neural Models
## 3 Approach
### Classification  
#### 3.2.1 Convolutional Neural Network (CNN)  
To perform the sentiment classification task, we propose a neurocomputing-based approach. A CNN is a kind of feed-forward network structure that consists of multiple layers of convolutional filters followed by subsampling filters and ends with a fully connected classification layer. The classical LeNet-5 CNN was first proposed by [PERSON] et al. [22], which is the basic model of different CNN applications for object detection, localization, and prediction. First, the output vectors of the review to vector Algorithm 1 are converted to matrices where the goal is to make the application of CNN model possible. As illustrated in Figure 1, the proposed CNN model has one convolutional layer, one subsampling layer, and an output layer.  
The convolutional layers generate feature maps using five (2 \(\times\) 2) filters followed by a Scaled Exponential Linear Units (SELU) [23] as an activation function. Additionally, in the subsampling layers, the generated feature maps are spatially dissembled. In our proposed model, the feature maps in layers are subsampled to a corresponding feature map of size 2 \(\times\) 2 in the subsequent layer.  
The final layer, which is a fully CNN model that performs the classification process, consists of three layers. The first layer is the input layer which has 6125 nodes and the second that has five nodes. Each SELU activation function The final layer is the softmax output layer. The result of the mentioned layers is a 2D representation of extracted features from input feature map(s) based on the input features for the reviews.  
```
1:Input:word_features, Reviews
2:
3:functionReview_To_Vector(Reviews)
4:
5:all_features = [ ]
6:for review in reviews do
7:words = word_tokenize(review)
8:
9:features =[ ]
10:
11:for win word_features do
12:
13:if (w in words) then
14:
15:Features[w] = 1
16:
17:else
18:Features[w] = 0
19:endif
20:
21:endfor
22:
23:all_features+=[Features]
24:
25:endfor
26:
27:all_features+=[Features]
28:
29:endfor
30:return all_features
31:endfunction
32:
```  
**Algorithm 1**  
The proposed CNN consists of one convolutional layer and a max-pooling layer is because the small size of our input dimension does not require additional layers to extract features/patterns. The reason for using SELU is due to the fact that (a) SELUs performed better than Rectified Linear Units (RELUs), (b) SELUs offer self-normalization [23], and (c) they never lead to vanishing gradients problem. Since the dropout is a regularization technique to avoid over-fitting in neural networks  
Figure 1: The proposed CNN model.  
based on preventing complex co-adaptations on training data [24], our dropout for each layer was 0.75, which is related to the fraction of the input units to drop.  
The proposed CNN model has been trained on IMDb. Then, the model has been saved to be tested on other datasets. The length of the considered feature vectors is 4900 words that are converted to matrices of size (70 \(\times\) 70).  
The parameters of CNN are selected by using grid search from a scikit-learn library considering different settings. Table 2 shows parameters used for all the layers of the proposed CNN model.