Emotion Classification in Indonesian Language: A CNN Approach with Hyperband Tuning


  • Muhammad Yeza Baihaqi National Taiwan University of Science and Technology
  • Edmun Halawa Mechanical Engineering, President University
  • Riri Asyahira Sariati Syah Environmental Engineering, President University
  • Anniza Nurrahma Psychology, Jakarta State University
  • Wilbert Wijaya Electrical Engineering, President University




convolutional neural network, emotion classification, feature extraction, hyperband tuner


In today's world, there is a high demand for accurate techniques to classify emotions in various fields. This study proposed utilizing a Convolutional Neural Network (CNN) optimized with a Hyperband Tuner (HT) to perform the Emotion Classification task in the Indonesian language effectively. Various feature extraction techniques experiments were conducted to explore the best combinations of feature extraction and CNN for the data set, including CountVectorizer (CV), TF-IDF, and Keras Tokenizer (KT). Last, the proposed methodology was evaluated and compared to the stateof-the-art techniques, including K-Nearest Neighbors (KNN), Decision Tree (DT), Naive Bayes (NB), and Boosting SVM. The experimental results revealed that the proposed method in this research outperforms the existing technique as evidenced by the accuracy, precision, recall, and F1-score metrics, which respectively reached 71.5655%, 71.5483%, 71.5655%, and 71.0041%.


Y. Du, R. G. Crespo, and O. S. Martínez, “Human emotion recognition for enhanced performance evaluation in e-learning,” Progress in Artificial Intelligence, vol. 12, no. 2, pp. 199–211, June 2023.

W. Graterol, J. Diaz-Amado, Y. Cardinale, I. Dongo, E. Lopes-Silva, and C. Santos-Libarino, “Emotion Detection for Social Robots Based on NLP Transformers and an Emotion Ontology,” Sensors, vol. 21, no. 4, pp. 1–19, February 2021.

M. Y. Baihaqi and S. S.-D. Xu, “Seven stages of action for the interaction design of the customer service of a robot in a shopping mall,” in Proc. International Conference on Advanced Robotics and Intelligent Systems, Taipei, Taiwan, August 24–27, 2022, p.1.

B. Y. Pratama and R. Sarno, “Personality classification based on Twitter text using Naive Bayes, KNN and SVM,” in Proc. International Conference on Data and Software Engineering, Yogyakarta, Indonesia, November 25–26, 2015, pp. 170–174.

A. Zamsuri, S. Defit, and G. W. Nurcahyo, “Classification of multiple emotions in Indonesian text using the k-nearest neighbor method,” Journal of Applied Engineering and Technological Science, vol. 4, no. 2, pp. 1012–1021, June 2023.

E. Nugraheni, “Indonesian twitter data pre-processing for the emotion recognition,” in Proc. International Seminar on Research of Information Technology and Intelligent Systems, Yogyakarta, Indonesia, December 5–6, 2019, pp. 58–63.

L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar, “Hyperband: A novel bandit-based approach to hyperparameter optimization,” Journal of Machine Learning Research, vol. 18, no. 185, pp. 1–52, April 2018.

N. Hayatin, S. Alias, L. Hung, and M. Sainin, “Sentiment analysis based on probabilistic classifier techniques in various Indonesian review data,” Jordanian Journal of Computers and Information Technology, vol. 8, no. 3, pp. 271-282, September 2022.

B. Harjito, A. Wijayanto, K. N. Aini, and B. Murtiyas, “Comparison of multinomial naïve bayes with k-nearest neighbors, support vector machine and random forest for classification of ‘network attacks’ document,” in Proc. International Conference on Informatics and Computing, Manado, Indonesia, October 16–17, 2019, pp. 1–6.

A. Rusli, A. Suryadibrata, S. B. Nusantara, and J. C. Young, “A comparison of traditional machine learning approaches for supervised feedback classification in Bahasa Indonesia,” International Journal of New Media Technology, vol. 7, no. 1, pp. 28–32, July 2020.

A. Maulana and H. Pratiwi, “Sentiment analysis of public towards infrastructure development in Indonesia on Twitter media using boosting support vector machine method,” in Proc. International Conference on Science and Applied Science, Jakarta, Indonesia, July 20, 2019, pp. 020082-1–020082-13.

M. V. S. Rishita, M. A. Raju, and T. A. Harris, “Machine translation using natural language processing,” MATEC Web of Conferences, vol. 277, no. 02004, pp. 1–6, April 2019.

J. Wu, “Introduction to convolutional neural networks,” National Key Lab for Novel Software Technology. Nanjing University. China, vol. 5, no. 23, pp. 1–31, May 2017.

Riccosan, K. E. Saputra, G. D. Pratama, and A. Chowanda, “Emotion dataset from Indonesian public opinion,” Data Brief, vol. 43, p. 108465, Aug. 2022, doi: 10.1016/j.dib.2022.108465.

M. S. Saputri, R. Mahendra, and M. Adriani, “Emotion classification on Indonesian twitter dataset,” in Proc, International Conference on Asian Language Processing, Bandung, Indonesia, November 15–18, 2018, pp. 90–95.

A. Librian, “Sastrawi: Stemmer Bahasa Indonesia (Indonesian Stemmer),” 2016. [Online]. Available: https://github.com/sastrawi/sastrawi. [Accessed: 25-May-2023].

S. Kiritchenko, W. Hipson, R. Coplan, and S. M. Mohammad, “SOLO: A corpus of tweets for examining the state of being alone,” in Proc. Language Resources and Evaluation Conference, Marseille, France, June 20–25 2020, pp. 1567–1577.

S. M. Mohammad, “Ethics Sheet for Automatic Emotion Recognition and Sentiment Analysis,” Computational Linguistics, vol. 48, no. 2, pp. 239–278, June 2022.

J. C. Jackson, J. Watts, J.-M. List, C. Puryear, R. Drabble, and K. A. Lindquist, “From text to thought: How analyzing language can advance psychological science,” Perspectives on Psychological Science, vol. 17, no. 3, pp. 805–826, May 2022.

A. Haleem, M. Javaid, M. Asim Qadri, R. Pratap Singh, and R. Suman, “Artificial intelligence (AI) applications for marketing: A literature-based study,” International Journal of Intelligent Networks, vol. 3, pp. 119–132, September 2022.