پیش‌بینی نوسانات قیمت سهام در بورس تهران با استفاده از اخبار روزانه با بهره‌گیری از شبکه توجه سلسله‌مراتبی تقویت‌شده با BERT

نوع مقاله : علمی-پژوهشی

نویسندگان

1 دانشکده مهندسی کامپیوتر، دانشگاه یزد، یزد، ایران

2 دانشگاه یزد

چکیده

با توجه به نقش مهم بازار سهام در اقتصاد جهانی، همواره نیاز به روش‌هایی دقیق‌تر برای پیش‌بینی رفتار آن احساس می‌شود. یکی از چالش‌های اصلی در این حوزه، نحوه استفاده مؤثر از اخبار در پیش‌بینی روند بازار است. در این پژوهش، یک مکانیزم توجه سلسله‌مراتبی جدید معرفی شده که هدف آن بهبود عملکرد مدل‌های پیش‌بینی بازار سهام است. ایده اصلی این رویکرد بر این فرض استوار است که همه بخش‌های یک خبر و هم‌چنین همه اخبار منتشرشده در یک روز معاملاتی، تأثیر یکسانی در شکل‌گیری روند بازار ندارند.
بر همین اساس، در این مقاله مدلی مبتنی بر شبکه توجه سلسله‌مراتبی همراه با BERT با نام HAN+BERT ارائه می‌شود که ساختار سلسله‌مراتبی اخبار را در نظر گرفته و به هر خبر متناسب با میزان اهمیت آن در پیش‌بینی بازار وزن اختصاص می‌دهد. این مدل قادر است در هر روز معاملاتی، تأثیرگذارترین اخبار را شناسایی کرده و در متن هر خبر نیز مهم‌ترین جملات و واژگان را استخراج کند. برای دستیابی به این هدف، از مکانیزم توجه درسه سطح واژه، جمله و خبر استفاده شده است.
به‌کارگیری BERT به ‌عنوان روش تعبیه‌سازی واژگان باعث شده مدل بتواند معنا و زمینه‌ی مفهومی اخبار را با دقت بیشتری درک کند و در نتیجه عملکرد بهتری در پیش‌بینی روند بازار سهام ارائه دهد. نتایج آزمایش‌های انجام شده بر روی مجموعه‌ای از اخبار مالی فارسی نشان می‌دهد که مدل پیشنهادی HAN+BERT در مقایسه با روش‌های مرجع، دقت بالاتری داشته و بهبود محسوسی در پیش‌بینی تغییرات بازار ایجاد می‌کند.

کلیدواژه‌ها


عنوان مقاله [English]

Tehran Stock Exchange Price Movement Prediction using Daily News with Hierarchical Attention Network Plus BERT

نویسندگان [English]

  • Leila Hafezi 1
  • Mohammad Reza Pajoohan 2
  • Sajjad Zarifzadeh 1
1 Computer Engineering Department, Yazd University, Yazd, Iran
2 Computer Engineering Department, Yazd University, Yazd, Iran
چکیده [English]

The stock market’s significance in the global economy necessitates demands more accurate prediction methods. This paper introduces a novel hierarchical attention mechanism aimed at enhancing the performance of predicting stock price movements. Hierarchical attention networks assume that not all news segments hold equal relevance in forecasting stock market trends. Furthermore, we assert that not all daily news carries an equivalent significance in predicting market trends. To tackle this challenge, we suggest a hierarchical attention network plus BERT that emulates the news hierarchy and assigns weights to news items based on their significance, and also the most informative news articles in each trading day in stock market prediction. Our HAN+BERT method incorporates three levels of attention mechanisms, operating at the word, sentence, and news level. This allows the model to identify the most significant news stories of the day and select the most informative sentences and words within these articles. Using BERT as the word embedding approach has resulted in better performance for our stock trend prediction model. Empirical results on Persian financial news and three stock market indices reveal the effectiveness of our HAN+BERT model, with a peak accuracy of 65.49%, which is 3% higher than the best baseline model.

کلیدواژه‌ها [English]

  • Deep learning models
  • stock market prediction
  • attention mechanism
  • hierarchical attention network
  • BERT embedding
[1] P. Y. Hao, C. F. Kung, C. Y. Chang, J. Ou, “Predicting stock price trends based on financial news articles and using a novel twin support vector machine with fuzzy hyperplane,” Applied Soft Computing, vol. 98, 2021.
[2] M. F. Shams, M. Mohammadi, “A model for price manipulation prediction case study: Tehran Stock Exchange”, Economic Research, vol. 11, pp. 30-41, 2011.
[3] M. H. Ziya, A. Vatanka, “The Iranian government’s risky stock market bet”, Online Content, 2020.
[4] J. Qiu, B. Wang, C. Zhou, “Forecasting stock prices with long-short term memory neural network based on attention mechanism”, PLoS One, vol. 15, no. 1, 2020.
[5] Z. Yang, D. Yang, C. Dyer, X. He, A. Smola, E. Hovy, “Hierarchical attention networks for document classification”, In the association for computational linguistics: human language technologies, June 2016, San Diego, California, pp. 1480-1489.
[6] L. Huang, H. Yan, S. Ying, Y. Li, R. Miao, C. Chen, Q. Su, “Hierarchical attention network in stock prediction”, In the Information Retrieval (Springer), August 2020, China, pp. 124-136.
[7] Q. Liu, X. Cheng, S. Su, S. Zhu, “Hierarchical complementary attention network for predicting stock price movements with news”, In the ACM International Conference on Information and Knowledge Management, October 2018, Italy, pp. 1603-1606.
[8] J. Liu, H. Lin, L. Yng, B. Xu, D. Wen, “Multi-element hierarchical attention capsule network for stock prediction” IEEE Access, vol. 8, pp. 143114-143123, 2020.
[9] H. Bi, L. Lu, Y. Meng, “Hierarchical attention network for multivariate time series long-term forecasting” Applied Intelligence, vol. 53, pp. 5060-5071, 2023.
[10] C. Wang, P. Nulty, D. Lillis, “A comparative study on word embeddings in deep learning for text classification”, In the 4th International Conference on Natural Language Processing and Information Retrieval, February 2020, New York, USA, pp. 37–46.
[11] A. Mohammadi, M. Yazdian-Dehkordi, M. A. Nematbakhsh, “Identification of Implicit Features using Persian Language Rules and Sentiments Clustering”, Tabriz Journal of Electrical Engineering, Vol. 50, no. 3, pp. 1395-1404, 2020 (In Persian).
[12] F. Moodi, A. Jahangard-Rafsanjani, S. Zarifzadeh, ‘‘Improving stock price prediction using technical indicators and sentiment analysis,’’ Tabriz Journal of Electrical Engineering, 2024 (In Persian).
[13] X. Chen, X. Ma, H. Wang, X. Li, C. Zhang, “A hierarchical attention network for stock prediction based on attentive multi-view news learning”, Neurocomputing, vol. 504, pp. 1-15, 2022.
[14] J. Zhang, L. Ye, Y. Lai, “Stock price prediction using CNN-BiLSTM-Attention model”, Mathematics, vol. 11, no. 9, 2023.
[15] Q. Zhang, C. Qin, Y. Zhang, F. Bao, C. Zhang, P. Liu, “Transformer-based attention network for stock movement prediction”, Expert Systems with Applications, vol. 202, 2022.
[16] X. Zhang, S. Liu, X. Zheng, “Stock price movement prediction based on a deep factorization machine and the attention mechanism”, Mathematics, vol. 9, no. 8, 2021.
[17] S. Li, S. Xu, “Enhancing stock price prediction using GANs and transformer-based attention mechanisms”, Empirical Economics, vol. 68, pp. 373–403, 2025.
[18] W. Liu, Y. Ge, Y. Gu, “News-driven stock market index prediction based on trellis network and sentiment attention mechanism”, Expert Systems with Applications, Vol. 250, 2024.
[19] J. Devlin, M. Chang, K. Lee, K. Toutanova, “BERT: Pre-training of deep bidirectional transformers for language understanding”, In the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, May 2019, Minneapolis, Minnesota. Association for Computational Linguistics, pp. 4171–4186.
[20] M. Farahani, M. Gharachorloo, M. Farahani, “ParsBERT: Transformer-based model for Persian language understanding”, Neural Process Letter, vol. 53, pp. 3831–3847, 2021.
[21] K. Cho, B. V. Merrienboer, D.  Bahdanau, Y. Bengio, “On the properties of neural machine translation: encoder-decoder approaches”, In SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation, October 2014, Qatar, pp. 103-111.
[22] J. Chung, C. Gulcehre, K. Cho, Y. Bengio, “Empirical evaluation of gated recurrent neural networks on sequence modeling”, Workshop on Deep Learning, 2014.
[23] Y. Liu, Q. Zeng, H. Yang, A. Carrio, “stock price movement prediction from financial news with deep learning and knowledge graph embedding”, Knowledge Management and Acquisition for Intelligent Systems, July 2018, China, pp. 102-113.
[24] G. Liu, J. Guo, “Bidirectional LSTM with attention mechanism & convolutional layer for text classification”, Neurocomputing, vol. 337, pp. 325-338, 2019.
[25] V. Sanh, L. Debut, J. Chaumond, Th. Wolf, “DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter”, arXiv preprint arXiv:1910.01108, 2019.
[26] T. H. Nguyen, K. Shirai, “Topic modeling-based sentiment analysis on social media for stock market prediction”, In the association for computational linguistics and the 7th international joint conference on natural language processing, July 2015, China, pp. 1354–1364.