In the digital era, where emotions play a crucial role in shaping human behavior, communication, and decision-making, their expressions are often conveyed through short and informal texts on platforms such as Twitter. This research aims to improve the accuracy of emotion detection in Indonesian text using the IndoBERT-BASE-P2 and IndoBERT-LARGE-P2 transformer models. The dataset consists of 7,080 tweets annotated with six basic emotion categories (anger, fear, joy, love, neutral, and sad). The research methodology included text preprocessing, class balancing using SMOTE, and fine-tuning with optimized training parameters. Evaluation results show that IndoBERT-BASE-P2 achieved an accuracy of 84.43% and a macro F1-score of 84.33%, surpassing previous studies, while the larger IndoBERT-LARGE-P2 model tended to overfit and offered no meaningful improvement. Error analysis showed the neutral class was the most difficult to classify. These findings demonstrate that with effective preprocessing and parameter optimization, a smaller model can be a highly efficient solution for emotion classification in Indonesian text, especially in resource-constrained conditions.
Copyrights © 2026