Sentiment Analysis Using Bidirectional Encoder Representations from Transformers for Indonesian Stock Price Prediction with Long Short-Term Memory and Gated Recurrent Unit Models

Authors

  • Dwi Utari Iswavigra Bachelor of Computer Science Program, Sugeng Hartono University, Indonesian
  • Very Dwi Setiawan Bachelor of Informatics Program, Pignatelli Triputra University, Indonesia
  • Mutia Ulfa Digital Business Bachelor Program, Sugeng Hartono University, Indonesian
  • Brieva Ommr Bachelor of Computer Science Program, Sugeng Hartono University, Indonesian

DOI:

https://doi.org/10.52436/1.jutif.2026.7.2.5383

Keywords:

indobert, sentiment analysis, stock price prediction, lstm–gru, natural language processing, financial technology

Abstract

The advancement of artificial intelligence based market analytics has driven the need for stock price prediction models capable of representing market behavior both technically and psychologically. This study aims to improve stock price forecasting in the Indonesian capital market by integrating sentiment analysis with deep learning time-series models. It evaluates whether public sentiment can contribute to enhancing prediction accuracy when combined with historical stock data. Textual sentiments were extracted using IndoBERT and converted into positive, negative, and neutral scores, which were then merged with historical stock prices. These data were modeled using LSTM, GRU, and a hybrid LSTM–GRU architecture. Model evaluation was conducted using MSE, MAE, RMSE, and MAPE metrics across six Indonesian stocks ANTM, BBCA, BBRI, SCMA, TLKM, and UNVR. The hybrid LSTM–GRU model produced the lowest prediction errors for BBCA and BBRI, with MSE scores of 0.151 and 1022.062, respectively. GRU delivered the best performance for highly volatile stocks, such as SCMA MAPE 1.65% and UNVR MAPE 0.51%, while LSTM demonstrated the most stable performance for TLKM with an MSE of 606.93 and RMSE of 24.63. Across all cases, sentiment scores improved model responsiveness, particularly during price spikes ANTM mid-2025 and price declines BBRI early year. The integration of sentiment significantly enhances prediction relevance by combining psychological market indicators with technical price trends. This framework provides more reliable decision-making support for investors, strengthens algorithmic trading strategies in Indonesia, and contributes to intelligent financial analytics that reflect local market behavior.

Downloads

Download data is not yet available.

References

P. Chhajer, M. Shah, and A. Kshirsagar, “The applications of artificial neural networks, support vector machines, and long–short term memory for stock market prediction,” Decis. Anal. J., vol. 2, p. 100015, 2022, doi: https://doi.org/10.1016/j.dajour.2021.100015.

A. Al Masud and B. Uluyol, “Investors’ demand in Initial Public Offering (IPO): Shariah compliance, corporate governance and macroeconomic factors,” J. Islam. Account. Bus. Res., 2024, doi: 10.1108/JIABR-09-2023-0292.

R. Aljifri, “Investor psychology in the stock market: An empirical study of the impact of overconfidence on firm valuation,” Borsa Istanbul Rev., vol. 23, no. 1, pp. 93–112, 2023, doi: https://doi.org/10.1016/j.bir.2022.09.010.

M. Anhar, R. Maronrong, A. Burda, and L. O. Sumail, “Dynamics of Indonesian stock market interconnection: Insights from selected ASEAN countries and global players during and after the COVID-19 pandemic,” Invest. Manag. Financ. Innov., vol. 21, no. 2, pp. 180–190, 2024, doi: 10.21511/imfi.21(2).2024.14.

P. C. Sia, C. M. Leong, and C. H. Puah, “Asymmetric effects of inflation rate changes on the stock market index: The case of Indonesia,” J. Int. Stud., vol. 16, no. 1, pp. 128–141, 2023, doi: 10.14254/2071-8330.2023/16-1/9.

G. Cao and J. Weerawardena, “Strategic use of social media in marketing and financial performance: The B2B SME context,” Ind. Mark. Manag., vol. 111, pp. 41–54, 2023, doi: https://doi.org/10.1016/j.indmarman.2023.03.007.

S. Mukherjee, B. Sadhukhan, N. Sarkar, D. Roy, and S. De, “Stock market prediction using deep learning algorithms,” CAAI Trans. Intell. Technol., vol. 8, no. 1, pp. 82–94, 2023, doi: 10.1049/cit2.12059.

J. Shah, D. Vaidya, and M. Shah, “A comprehensive review on multiple hybrid deep learning approaches for stock prediction,” Intell. Syst. with Appl., vol. 16, p. 200111, 2022, doi: https://doi.org/10.1016/j.iswa.2022.200111.

M. M. Akhtar, A. S. Zamani, S. Khan, A. S. A. Shatat, S. Dilshad, and F. Samdani, “Stock market prediction based on statistical data using machine learning algorithms,” J. King Saud Univ. - Sci., vol. 34, no. 4, p. 101940, 2022, doi: https://doi.org/10.1016/j.jksus.2022.101940.

A. Kurani, P. Doshi, A. Vakharia, and M. Shah, “A Comprehensive Comparative Study of Artificial Neural Network (ANN) and Support Vector Machines (SVM) on Stock Forecasting,” Ann. Data Sci., vol. 10, no. 1, pp. 183–208, 2023, doi: 10.1007/s40745-021-00344-x.

H. D. Khanh, S. Y. Kim, and L. Q. Linh, “Construction productivity prediction through Bayesian networks for building projects: case from Vietnam,” Eng. Constr. Archit. Manag., vol. 30, no. 5, pp. 2075–2100, 2022, doi: 10.1108/ECAM-07-2021-0602.

D. Muhammad, I. Ahmed, K. Naveed, and M. Bendechache, “An explainable deep learning approach for stock market trend prediction,” Heliyon, vol. 10, no. 21, Nov. 2024, doi: 10.1016/j.heliyon.2024.e40095.

D. Wu, X. Ma, and D. L. Olson, “Financial distress prediction using integrated Z-score and multilayer perceptron neural networks,” Decis. Support Syst., vol. 159, p. 113814, 2022, doi: https://doi.org/10.1016/j.dss.2022.113814.

M. S. Hafshejani and N. Mansouri, “Enhancing Stock Market Prediction with LSTM: A Review of Recent Developments and Comparative Analysis,” Arch. Comput. Methods Eng., 2025, doi: 10.1007/s11831-025-10370-0.

K. Alam, M. H. Bhuiyan, I. U. Haque, M. F. Monir, and T. Ahmed, “Enhancing Stock Market Prediction: A Robust LSTM-DNN Model Analysis on 26 Real-Life Datasets,” IEEE Access, vol. 12, pp. 122757–122768, 2024, doi: 10.1109/ACCESS.2024.3434524.

Q. Liu, Z. Tao, Y. Tse, and C. Wang, “Stock market prediction with deep learning: The case of China,” Financ. Res. Lett., vol. 46, p. 102209, 2022, doi: https://doi.org/10.1016/j.frl.2021.102209.

P. J. Mandviwala, “Comparative Study of Different Machine Learning Methodology Used for Stock Price Prediction,” Int. J. Res. Appl. Sci. Eng. Technol., vol. 13, no. 4, pp. 5086–5093, 2025, doi: 10.22214/ijraset.2025.69326.

Y. Sun, H. Yuan, and F. Xu, “Financial sentiment analysis for pre-trained language models incorporating dictionary knowledge and neutral features,” Nat. Lang. Process. J., vol. 11, p. 100148, 2025, doi: https://doi.org/10.1016/j.nlp.2025.100148.

A. Jazuli, Widowati, and R. Kusumaningrum, “Optimizing Aspect-Based Sentiment Analysis Using BERT for Comprehensive Analysis of Indonesian Student Feedback,” Appl. Sci., vol. 15, no. 1, 2025, doi: 10.3390/app15010172.

V. D. Setiawan, D. U. Iswavigra, and E. Anggiratih, “Implementation of IndoBERT for Sentiment Analysis of the Constitutional Court ’ s Decision Regarding the Minimum Age of Vice Presidential Candidates,” Sci. J. Informatics, vol. 12, no. 3, pp. 397–406, 2025, doi: 10.15294/sji.v12i3.26360.

E. Yulianti and N. K. Nissa, “ABSA of Indonesian customer reviews using IndoBERT: single-sentence and sentence-pair classification approaches,” Bull. Electr. Eng. Informatics, vol. 13, no. 5, pp. 3579–3589, 2024, doi: 10.11591/eei.v13i5.8032.

C. Shaw, P. LaCasse, and L. Champagne, “Exploring emotion classification of indonesian tweets using large scale transfer learning via IndoBERT,” Soc. Netw. Anal. Min., vol. 15, no. 1, p. 22, 2025, doi: 10.1007/s13278-025-01439-6.

J. Kumarappan, E. Rajasekar, S. Vairavasundaram, K. Kotecha, and A. Kulkarni, “Federated Learning Enhanced MLP–LSTM Modeling in an Integrated Deep Learning Pipeline for Stock Market Prediction,” Int. J. Comput. Intell. Syst., vol. 17, no. 1, p. 267, 2024, doi: 10.1007/s44196-024-00680-9.

F. M. M. Alsheebah and B. A. Al-Fuhaidi, “Emerging Stock Market Prediction Using GRU Algorithm: Incorporating Endogenous and Exogenous Variables,” IEEE Access, vol. 12, pp. 132964–132971, 2024, doi: 10.1109/ACCESS.2024.3444699.

A. Farhadi, A. Zamanifar, A. Alipour, A. Taheri, and M. Asadolahi, “A Hybrid LSTM-GRU Model for Stock Price Prediction,” IEEE Access, vol. 13, pp. 117594–117618, 2025, doi: 10.1109/ACCESS.2025.3586558.

J. D. Hughes, M. J. Russcher, C. D. Langevin, E. D. Morway, and R. R. McDonald, “The MODFLOW Application Programming Interface for simulation control and software interoperability,” Environ. Model. Softw., vol. 148, p. 105257, 2022, doi: https://doi.org/10.1016/j.envsoft.2021.105257.

K. Purwandari, R. B. Perdana, J. W. C. Sigalingging, R. Rahutomo, and B. Pardamean, “Automatic Smart Crawling on Twitter for Weather Information in Indonesia,” Procedia Comput. Sci., vol. 227, pp. 795–804, 2023, doi: 10.1016/j.procs.2023.10.585.

S. Abolmakarem, F. Abdi, K. Khalili-Damghani, and H. Didehkhani, “A multi-stage machine learning approach for stock price prediction: Engineered and derivative indices,” Intell. Syst. with Appl., vol. 24, p. 200449, 2024, doi: https://doi.org/10.1016/j.iswa.2024.200449.

K. Kusnawi and K. Anam, “Comparison ff Sentiment Labeling Using Textblob, Vader, and Flair in Public Opinion Analysis Post-2024 Presidential Inauguration with IndoBERT,” J. Tek. Inform., vol. 6, no. 2, pp. 803–818, 2025, doi: 10.52436/1.jutif.2025.6.2.4015.

V. D. Setiawan and D. U. Iswavigra, “Sentiment Analysis to Evaluate Public Service Perception among Surakarta City Residents Using the BiLSTM Model,” J. Informatics Telecommun. Eng., vol. 9, no. July, pp. 229–239, 2025.

G. Xu, S. Zhang, and W. Shi, “Instantaneous prediction of irregular ocean surface wave based on deep learning,” Ocean Eng., vol. 267, no. November 2022, p. 113218, 2023, doi: 10.1016/j.oceaneng.2022.113218.

Additional Files

Published

2026-04-15

How to Cite

[1]
D. U. Iswavigra, V. D. . Setiawan, M. . Ulfa, and B. . Ommr, “Sentiment Analysis Using Bidirectional Encoder Representations from Transformers for Indonesian Stock Price Prediction with Long Short-Term Memory and Gated Recurrent Unit Models”, J. Tek. Inform. (JUTIF), vol. 7, no. 2, pp. 961–976, Apr. 2026.