BERT for Sentiment Analysis on Rotten Tomatoes Reviews
Aji Gautama Putrada, Nur Alamsyah, Mohamad Nurkamal Fauzan · 2023
Transformer is a neural network model whose trend is rising because ChatGPT shocked the world with its general answering and questioning system capabilities. The bidirectional encoder representation transformer (BERT) is also one of the other pre-trained transformer models. However, there are research opportunities to use BERT in sentiment analysis for the Rotten Tomatoes review. Our research aims to use BERT for sentiment analysis on the Rotten Tomatoes dataset and evaluate the results. Our research step is to get the Rotten Tomatoes dataset from the Huggingface dataset. We do pre-processing for the BERT model, tune the BERT model, then train the model using the dataset. We use the lightweight pre-trained DistilBERT as part of our proposed model. We compare the performance of our BERT model with three state-of-the-art benchmark methods: support vector machine with term frequency-inverse document frequency (SVM+TF-IDF), naïve Bayes with TF-IDF (NB+TF-IDF), and convolutional neural network (CNN). We use several test metrics such as accuracy, precision, recall, f1-score, and area under the curve (AUC) from the receiver operating curve (ROC). In the training optimization process, we learned that AdamW is more effective than Adam optimizer. Our test results show that BERT’s performance is better than the other three models with Accuracy, Precision, Recall, and F1-Scores of 0.753, 0.754, 0.754, and 0.753, respectively. Finally, BERT is also the best in terms of AUC, with a value of 0.826.