Implementation of the Naïve Bayes Algorithm for Sentiment Analysis of Portos Coffee Shop Customer Reviews Using a Natural Language Processing (NLP) Approach
Abstract
This study implements the Multinomial Naïve Bayes (MNB) algorithm with a Natural Language Processing (NLP) approach to classify customer sentiment toward Portos Coffee Shop and builds a web-based monitoring system. A total of 586 reviews from Google Maps (525) and Instagram (61), collected in 2026, were preprocessed with Sastrawi stemming, weighted using TF-IDF, and labeled by a hybrid rating–InSet lexicon method. Hold-out testing (80:20) achieved 87.29% accuracy and a 90.20% F1-score, while 5-fold cross-validation averaged 90.79% accuracy. Positive sentiment accounted for 62.12% of reviews. The model was deployed using FastAPI, Next.js, PostgreSQL, and Docker, and passed all unit and black-box tests.