Sentiment Analysis of Twitter's Opinion on The Russia and Ukraine War Using Bert

  • Muhammad Fahmi Julianto (1) Universitas Bina Sarana Informatika
  • Yesni Malau (2) Universitas bina Sarana Informatika
  • Wahyutama Fitri Hidayat (3*) Universitas Bina Sarana Informatika

  • (*) Corresponding Author
Keywords: War, Russia-Ukraine, Sentiment, Sentiment Analysis, BERT


News about the war that took place between Russia and Ukraine can not be denied affecting various aspects of life in the world. This affects the writings of every citizen of the world on various social media platforms, one of which is Twitter. Sentiment analysis is a process of identifying and making sentiment categories which is done computationally. Sentiment analysis process is also intended to make computers understand the meaning of sentences written by humans by processing using algorithms. This study uses a deep learning method using a language model, namely BERT (Bidirectional Encoder Representation Form Transformers) as a process of analyzing the sentiments that exist in tweets written about the war in Russia and Ukraine by twetter social media users. These sentiments will be divided into three parts, namely positive, neutral and negative. In this study, the hyperparameters used were 10 epochs, learning rate 2e-5, and batch size 16. The sentiment analysis test used the BERTbase Multilingual-cased-model model and the accuracy value obtained was 97%.


Download data is not yet available.


Aditya, A., & Wibowo, A. (2022). Analisis Sentimen Menggunakan Metode Naïve Bayes Berdasarkan Opini Masyarakat Dari Twitter Terhadap Perang Rusia dan Ukraina. Seminar Nasional Mahasiswa Fakultas Teknologi Informasi (SENAFTI) Universitas Budi Luhur, (September), 138–145. Jakarta: Universitas Budi Luhur.

Alammar, J. (2021). The Illustrated BERT, ELMo, and co. (How NLP Cracked Transfer Learning).

Andraini, F., & Mahdiyah, E. (2022). Analisis Sentimen Twitter Terhadap Peperangan Rusia Dan Ukraina Menggunakan Algoritma Support Vector Machine. Jurnal Aplikasi Komputer, 2(1), 46–58.

Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 4171–4186. Minneapolis, Minnesota: Association for Computational Linguistics.

El Rifai, H., Al Qadi, L., & Elnagar, A. (2022). Arabic text classification: the need for multi-labeling systems. Neural Computing and Applications, 34(2), 1135–1159.

Fatima, A., Nazir, N., & Khan, M. G. (2017). Data Cleaning In Data Warehouse: A Survey of Data Pre-processing Techniques and Tools. International Journal of Information Technology and Computer Science, 9(3), 50–61.

Kumar, A., Jaiswal, A., Garg, S., Verma, S., & Kumar, S. (2022). Sentiment Analysis Using Cuckoo Search for Optimized Feature Selection on Kaggle Tweets. IGI Global Publisher of Timely Knowledge, 19.

Lomet, D. B. (2001). Bulletin of the Technical Committee on Data Engineering. Bulletin of the Technical Committee on Data Engineering, 24(4), 1–56. Retrieved from papers2://publication/uuid/30073F7F-1B7C-4496-ADA4-94FF4E6EE8F7

McCormick, C., & Ryan, N. (2019). BERT Fine-Tuning Tutorial with PyTorch.

Osinga, D. (2018). Deep Learning Cookbook (1st ed.). Sebastopol, California: O'Reilly Media.

Song, Y., Wang, J., Liang, Z., Liu, Z., & Jiang, T. (2020). Utilizing BERT intermediate layers for aspect-based sentiment analysis and natural language inference. arXiv.

Sudiq, R. dwinanda, & Yustitianingtyas, L. (2022). Intervensi rusia terhadap ukraina pada tahun 2022 sebagai Pelanggaran Berat HAM. Jurnal Pendidikan Kewarganegaraan Undiksha, 10(3), 101–117.

Sun, C., Qiu, X., Xu, Y., & Huang, X. (2019). How to Fine-Tune BERT for Text Classification? Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics).

Suresha, A. M. (2020). Sentiment Analysis on Amazon Product Reviews with Stacked Neural Networks. Https://Www.Researchgate.Net/Publication/344518660_Sentiment_Analysis_on_Amazon_Product_Reviews_with_Stacked_Neural_Networks, (October).

Valkov, V. (2020). Sentiment Analysis with BERT and Transformers by Hugging Face using PyTorch and Python.

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., … Polosukhin, I. (2017). Attention is all you need. 31st Conference on Neural Information Processing Systems (NIPS 2017), 1–11. Long Beach: NeurIPS.

Wiegreffe, S., & Marasović, A. (2021). Teach Me to Explain: A Review of Datasets for Explainable Natural Language Processing. (NeurIPS). Retrieved from

Yaswanth, V. (2022). Russia Vs Ukraine Tweets: Tweets of the war that is happening between the Nations.

Yutika, C. H., Adiwijaya, A., & Faraby, S. Al. (2021). Analisis Sentimen Berbasis Aspek pada Review Female Daily Menggunakan TF-IDF dan Naïve Bayes. Jurnal Media Informatika Budidarma, 5(2), 422.

How to Cite
Julianto, M., Malau, Y., & Hidayat, W. (2022). Sentiment Analysis of Twitter’s Opinion on The Russia and Ukraine War Using Bert. Jurnal Riset Informatika, 5(1), 459-468.
Article Metrics

Abstract viewed = 94 times
PDF downloaded = 83 times