## 2 Materials and Methods  
### Recurrent Neural Network  
The Recurrent Neural Network (RNN) is a type of neural network designed to process sequential data in a temporal dataset [42]. Long dependence relationships can be captured and stored using RNN models. Unlike other deep learning algorithms, RNN models use a look-back period, which is the number of previous time steps used to predict the next time step. The hidden RNN layers consist of RNN units, which, in turn, consist of RNN cells, with the number of cells in each unit corresponding to the look-back period. The number of hidden layers and units comprises the hyperparameters that should be set before training the model. The output of the cell \(C_{t}\) is determined by Equation (1):  
\[h_{t}=\sigma\big{(}W_{x_{t}}x_{t}+W_{h_{t}}h_{t-1}+b_{t}\big{)} \tag{1}\]  
where \(x_{t}\) is the input of the cell, \(h_{t-1}\) is the output of the cell \(C_{t-1}\), \(W_{x_{t}}\) is \(W_{h_{t-1}}\), and \(b_{t}\) are the weights and biases that should be trained and adjusted during the training of the model to minimize the loss function. The sigmoid function \(\sigma\) is used to add nonlinearity to the model.  
The RNN model has the disadvantage that, for large inputs, the gradient of the loss function can approach zero during training, which means that the weights of the first layer cannot be updated. Long Short-Term Memory (LSTM) is an artificial RNN architecture that allows gradients to flow unchanged, avoiding the vanishing gradient problem in classical RNN cells [43].  
In the LSTM layer, there are several gates such as the forget gate, the input gate, and the cell memory. These gates help to retain the useful information from the previous output layer and forget the information that is no longer useful to remember [44]. The LSTM cell must first decide which data in the cell to ignore using the forget gate. The forget gate outputs numbers between 0 and 1, where 1 denotes complete preservation of this information by parsing the output of the last cell, \(h_{t-1}\), and the input of the current cell, \(x_{t}\).  
\[f_{t}= \sigma(W_{f}[h_{t-1},x_{t}]+b_{f}) \tag{2}\] \[\sigma= \frac{1}{1+\mathrm{e}^{-x}} \tag{3}\]  
Equation (4) is used by the input gate \(i_{t}\) to determine which values to update while shielding the unit from unrelated inputs. Then, using Equation (5), the activation function \(\tanh\) creates a vector of new candidates \(\tilde{C}_{t}\) to add to the state.  
\[i_{t}= \sigma(W_{ix}x_{t}+W_{ih}h_{t-1}+b_{i}) \tag{4}\] \[\tilde{C}_{t}= \tanh(W_{zx}x_{t}+W_{zh}h_{t-1}+b_{z})\] (5) \[\tanh= \frac{(\mathrm{e}^{x}-\mathrm{e}^{-x})}{(\mathrm{e}^{x}+\mathrm{e }^{-x})} \tag{6}\]The unneeded information of the previous unit is then forgotten by multiplying the forget gate \(f_{t}\) by \(C_{t-1}\), while \(i_{t}\) is multiplied by \(\bar{C}_{t}\) to preserve the new valuable information (Equation (7)).  
\[C_{t}=f_{t}\odot C_{t-1}+i_{t}\odot\bar{C}_{t} \tag{7}\]  
What information is used in the cell to produce the output of the LSTM unit is determined by the output gate \(o_{t}\) through Equation (8).  
\[o_{t}=\sigma(W_{o}[h_{t-1},x_{t}]+b_{o}) \tag{8}\]  
Finally, the output of the unit is determined by Equation (9).  
\[h_{t}=o_{t}\odot\tanh(C_{t}) \tag{9}\]  
The weights (\(W\)) and biases (\(b\)) of the gates are changed during the LSTM training process to ensure that the loss function reaches the minimum value.  
A Bidirectional LSTM (BiLSTM) is a sequence-processing model consisting of two LSTM layers, one of which processes inputs forward and the other backward. Figure 1 shows a bidirectional LSTM layer.