Web-based sentiment analysis of environmental issues on social media X: A comparison of svm and random forest

Authors

  • Subandi Department of Smart City Information System, Politeknik Negeri Banjarmasin, Indonesia Author
  • Agus Setiyo Budi Nugroho Department of Computer Science, Politeknik Negeri Banjarmasin, Indonesia Author
  • Muhammad Hidayat Department of Multimedia Engineering Technology, Hasnur Polytechnic, Indonesia Author

DOI:

https://doi.org/10.52465/joscex.v7i2.55

Keywords:

Sentiment analysis, Support vector machine, Random forest, Social media X, Machine learning

Abstract

This study aims to compare the performance of Support Vector Machine (SVM) and Random Forest (RF) in classifying public sentiment toward environmental issues on social media X (formerly Twitter) and to develop a web-based system for sentiment monitoring and visualization. A total of 47,245 tweets from 2021–2025 were collected using 24 environmental keywords. The data were processed through text cleaning, tokenization, stopword removal, and stemming. Sentiment labeling was performed automatically using a lexicon-based approach with the InSet dictionary, resulting in positive, negative, and neutral classes. After filtering, 13,063 tweets were used for model training. Classification employed TF-IDF features and 5-fold cross-validation. The results indicate that SVM outperformed RF with an accuracy of 83%, compared to 81%. Both models performed well in identifying sentiment polarity, although challenges remain in classifying neutral sentiment. The novelty of this study lies in integrating lexicon-based labeling with machine learning and implementing it in a web-based system for automated analysis and visualization. Practically, this system supports stakeholders in monitoring public opinion and enables data-driven decision-making in environmental policy and management.

Downloads

Published

08-05-2026

Issue

Section

Articles

How to Cite

Web-based sentiment analysis of environmental issues on social media X: A comparison of svm and random forest. (2026). Journal of Soft Computing Exploration, 7(2), 288-299. https://doi.org/10.52465/joscex.v7i2.55

Similar Articles

1-10 of 20

You may also start an advanced similarity search for this article.