## 3 Methodology
Moreover, we have calculated the impact of the BOSentiment model in a convolution neural network (CNN) on the overall determining sentiment value of the data. In that case, we have created two new models:
* CNN (as a pure neural network model) and
* CNNBOSentiment model as a model that combines the BOSentiment model as a pre-model and CNN network as a main model to predict sentiment values. Since our data-set included sentiment data (negative \(=-1\), positive \(=1\), and neutral \(=0\)), we encoded each sentence with three labels, with one value representing the actual label. For instance, \"Negative\" was represented as \([1,0,0]\), \"Neutral\" as \([0,1,0]\), and \"Positive\" as \([0,0,1]\). We used the Tokenizer ([[https://www.tensorflow.org/api_docs/python/tf/keras/](https://www.tensorflow.org/api_docs/python/tf/keras/)]([https://www.tensorflow.org/api_docs/python/tf/keras/](https://www.tensorflow.org/api_docs/python/tf/keras/)) preprocessing/text/Tokenizer (accessed on 1 June 2023) ) and pad_sequences ([[https://www.tensorflow.org/api_docs/python/tf/keras/utils/pad_sequences](https://www.tensorflow.org/api_docs/python/tf/keras/utils/pad_sequences)]([https://www.tensorflow.org/api_docs/python/tf/keras/utils/pad_sequences](https://www.tensorflow.org/api_docs/python/tf/keras/utils/pad_sequences)) (accessed on 1 June 2023)) functions from Keras' preprocessing module to transform the text data into sequences of integers. The Tokenizer function is used to convert the text data into a numerical format by mapping each word in the text to a unique integer value. The pad_sequences function ensures that each sequence has the same length by padding the sequences with zeros or truncating them to a fixed length. As can be seen from Listing 1, we used seven layers in our model:  
* maps each word to a 32-dimensional vector. The number 5000 represents the total number of words in the vocabulary, and input_length represents the maximum length of input sequences that will be processed. In this case, the maximum sequence length is set to 32. * performs convolution on the input sequence using filters of size \(5\times 32\). The number 64 represents the number of filters used in the layer, and 'ReLu' indicates the activation function Rectified Linear Unit (ReLU) that is applied after convolution. * with pool_size is 4 were applied after Conv1D layer. MaxPooling1D applies max pooling operation to each feature dimension of the 3D input tensor (batch_size, steps, features), where steps represent the length of the sequence and features represent the number of features in each step. The pool_size is 4 means that the operation will pool four adjacent values at a time and return the maximum value of those four. This reduces the length of the sequence by a factor of 4 while retaining the most important features. The output of MaxPooling1D is a 3D tensor
with shape (batch_size, new_steps, features), where new_steps is the result of dividing the original steps by the pool_size (rounded down). * **Flatten** was applied after MaxPoolong1D layer. This layer flattens the input data into a one-dimensional array. In other words, it takes the 3D tensor output from the previous layer and converts it into a 1D array that can be used as input to a fully connected (Dense) layer. The output shape of the Flatten layer is a 1D tensor with a length equal to the product of the dimensions of the input tensor (batch_size, steps, features). Then, two Dense layers were applied. The reason for using Dense layers is to perform classification on the features extracted by the previous convolutional layers. After the feature maps have been flattened into a 1D array, Dense layers are added to the model to learn non-linear relationships between the features and the target variable. * a simple and computationally efficient function that returns the input value if it is positive, and 0 otherwise) activation function. It transforms the flattened feature vector into a new vector of length 64. This allows the model to learn more complex representations of the features.