Sentiment Analysis of Public Perception Towards Electric Cars in Indonesia Using the Naïve Bayes Algorithm

Main Article Content

M. Syahruni
Muhammad Alief Indra Putra
Amrullah Assalami

Abstract





The development of electric cars in Indonesia shows significant improvement alongside government efforts to reduce carbon emissions and promote renewable energy use. Public perception and opinions of electric cars are important factors influencing interest in owning these environmentally friendly vehicles. This study aims to analyze public sentiment toward electric cars in Indonesia using review data and comments from the social media platform X (Twitter). Data was collected through web scraping techniques and stored in CSV format for further processing using Google Colab. Preprocessing was performed to clean the text data, including removal of punctuation, numbers, symbols, Indonesian stopwords, tokenization, and stemming. The text was then converted into numerical representation using TF-IDF vectorization so it could be processed by the Naïve Bayes classification model. The model was then trained and tested to classify sentiment into three categories: positive, negative, and neutral. The results show that the majority of public comments about electric cars were negative, with a percentage reaching approximately 66.5%, while positive comments accounted for 33.5%. Further analysis revealed that negative sentiment was largely related to the relatively high vehicle prices and limited charging infrastructure. The Naïve Bayes model with CountVectorizer proved effective, achieving 78% accuracy, thus making it a reliable tool for sentiment analysis.





Article Details

Section
Articles

References

[1] D. Junaedi, E. Pujiyanto, M. Hisjam, dan R. W. Damayanti, “Purchase Intention of Electric Vehicles : A Systematic Literature Review,” Int. Summit Sci. Technol. Humanit., hal. 651–657, 2025, doi: https://doi.org/10.23917/iseth.5415.

[2] Q. Huda, “Analisis Sentimen Terhadap Mobil Listrik Di Indonesia Pada Twitter : Penerapan Naïve Bayes Classifier Untuk Memahami Opini Publik,” Just IT J. Sist. Informasi, Teknol. Inf. dan Komput., vol. 14, no. 2, hal. 87–93, 2024, doi: https://doi.org/10.24853/justit.14.2.87-93.

[3] A. Alfaro dan I. Mardiyah, “Sentiment Analysis Of Electric Car Product Trends In Indonesia Using BM25 And K-Nearest Neighbor Method,” Komputasi J. Ilm. Komput. Dan Mat., vol. 21, no. December 2023, hal. 1–11, 2024, doi: https://doi.org/10.33751/komputasi.v21i2.9382.

[4] Micheal dan M. I. Fianty, “G-Tech : Jurnal Teknologi Terapan Analysis,” vol. 8, no. 4, hal. 2675–2686, 2024, doi: https://doi.org/10.70609/gtech.v8i4.5405.

[5] Suryani, M. F. Fayyad, D. T. Savra, V. Kuniawan, dan B. H. Estanto, “Sentiment Analysis of Towards Electric Cars using Naive Bayes Classifier and Support Vector Machine Algorithm,” Public Res. J. Eng. Data Technol. Comput. Sci., vol. 1, no. July, hal. 1–9, 2023, doi: https://doi.org/10.57152/predatecs.v1i1.814.

[6] N. Afifah, D. Permana, D. Vionanda, dan D. Fitria, “Applying Naive Bayes Classifier Method for Sentiment Classification of Electric Cars,” UNP J. Stat. Data Scince, vol. 1, hal. 289–296, 2023, doi: DOI:10.24036/ujsds/vol1-iss4/68.