Analisis Sentimen Terhadap Ulasan Hotel XYZ Dengan Metode Naive Bayes Classifier

Authors

  • Rahul Rinaldo Siagian Universitas Lancang kuning Author
  • M. Sadar Universitas Lancang Kuning Author

Keywords:

Sentiment Analysis, Naive Bayes Classifier, Web Scraping, TF-IDF, Hotel Reviews

Abstract

The development of information technology and the increasing use of the internet have encouraged people to utilize online reviews as a consideration when choosing hotel accommodations. Customer reviews on platforms such as Traveloka contain opinions regarding service quality, facilities, and overall stay experience; however, they are presented in unstructured text form, making them difficult to analyze manually in large quantities. This study aims to analyze the sentiment of reviews for XYZ Hotel using the Naive Bayes Classifier (NBC) method and to determine the accuracy level of the resulting model. The data were collected through web scraping on April 29, 2025, resulting in a total of 2,091 reviews. The data processing stages included preprocessing steps consisting of case folding, cleansing, normalization, tokenizing, stopword removal, and stemming. Subsequently, sentiment labeling was conducted into two categories, namely positive and negative, resulting in 1,194 positive reviews and 897 negative reviews. The word weighting process used the TF-IDF method to identify dominant terms, which were then visualized using a word cloud to facilitate interpretation of text patterns. Classification was carried out using three data-splitting scenarios: 70%:30%, 80%:20%, and 90%:10% (training and testing). The results showed that the best performance was achieved with a 90% training and 10% testing data split, yielding an accuracy of 77.14%. The model performed better in identifying positive sentiment compared to negative sentiment. Overall, the Naive Bayes Classifier method is sufficiently effective for analyzing hotel review sentiment and can serve as a basis for decision-making in improving service quality.

Downloads

Published

2026-02-26