# A Two-Phase Deep Learning-Based Recommender System: Enhanced by a Data Quality Inspector
## 3 Materials and Methods
### Deep Learning-Based Quality Inspector
#### 3.2.2 Deep Learning-Based Sentiment Predictor  
The unique integer indexes, laying in the vectors of the same length, are projected to a dense vector space through the word embedding layer. The real-value matrices generated by the word embedding layer are the inputs of the deep learning network. Next to the deep learning layer, a Multi-Layer Perceptron (MPL) is applied. Let \(c_{i}\) be the \(i\)-th review vector, and \(r_{i}^{s}\) be the explicit rating for record \(i\). The deep learning-based sentiment predictor can be then modeled as:  
\[r_{i}^{s}=\phi_{out}\Big{(}\phi_{x}\Big{(}\dots\phi_{2}\Big{(}\phi_{1}\Big{(} \phi_{altn}\Big{(}\phi_{embedding}(c_{i})\Big{)}\Big{)}\Big{)}\dots\Big{)} \Big{)} \tag{4}\]  
where \(r_{i}^{s}\) is the predicted sentiment rating, \(\phi_{embedding}\) is the embedding mapping function, \(\phi_{altn}\) is the deep learning network mapping function, \(\phi_{x}\) is the mapping function for the MLP x-th layer, and \(\phi_{out}\) is the mapping function for the MLP output layer. The sentiment predictor utilizes a supervised learning technique for training, called backpropagation, where it tries to minimize the pointwise loss between \(r_{i}^{s}\) and its \(r_{i}^{s}\). The proposed deeplearning-based sentiment predictor is illustrated in Figure 2, and its accuracy can be determined using Equation (2). In this study, a total of five deep learning-based sentiment predictors are tested in dataset A to create a highly accurate quality inspector: (1) LSTM, (2) Bidirectional LSTM, (3) CNN, (4) Two Deep Views Ensemble method, and (5) BERT. * Model 1: Long-Short Term Memory Network  
Long-Short Term Memory (LSTM) [49] was mostly developed to counteract the main constraint of Recurrent Neural Network (RNN). That is, as the words dependency in a sequence is longer, and the gap between previous relevant data and the current position grows, RNN becomes unable to learn to connect the information and often encounter with exploding gradients problem [50]. LSTM has a chain-like structure and is capable of learning long-term dependencies as a result of four interacting neural network layers set in its repeating module: a forget gate, an input gate, a normal layer, and an output gate. * Model 2: Bidirectional LSTM  
Bidirectional LSTM (Bi-LSTM) [51] is an extension of a traditional LSTM. It trains two LSTM layers on an input sequence: the first as-is from right to left and the second on a reversed copy from left to right. This can provide additional context to the network and result in even fuller learning on the problem, improving in some cases performance on sequence classification problems. BI-LSTM can efficiently make use of past features via forward states, and future features via backward states, using information from both ends of the sequence to estimate the output. * Model 3: Convolutional Neural Network  
Convolutional neural network (CNN) is a category of deep learning neural networks that were designed with the main purpose to solve image (characters) recognition and classification tasks. It was developed by [52], and its architecture was called LeNet. Afterward, many different CNNs, based on LeNet, were developed, resulting in many successful applications in the computer vision field. Nowadays, it is also starting to be used in Natural Language Processing (NLP) area and has gotten interesting and promising results [53]. For the previous reason, it was selected as the third deep-learning model to being tested. * Model 4: Two Deep Views Ensemble Method  
Two Deep Views Ensemble method (TDVE) is a modified text classification model inspired by the methodology proposed by [28]. Their suggested framework was adapted to the specific case of this study. Thus, the factorization machines-based co-training component is excluded, the prediction component is slightly modified, and the two deep views module is used as the core idea of this fourth model.