Stock prediction using Bi-LSTM and RoBERTa sentiment analysis
Abstract
Stock price forecasting is a widespread research issue in the field of finance. Stock price prediction can give investors more accurate advice and yield higher returns. With the popularity of social media, more and more people choose to express their opinions, and more and more media outlets published news on social media. This paper mainly conducts stock analysis and prediction by presenting the RoBERTa-BiLSTM model with the Bahdanau attention mechanism. It consists of two existing models: the RoBERTa and bidirectional LSTM models. The experimental results show that this model is more accurate in predicting stock prices than the Multi-Layer Perception (MLP) and LSTM models. Inputs to the model include historical AAPL stock price data and sentiment data analysed by news and Twitter tweet sentiment. In this paper, the high-precision RoBERTa-BiLSTM model for stock prediction was proposed, which provides a solution for stock prediction. The practical applications and the typical problem of most studies about stock prediction called the “time-shifted problem”, are provided in this paper and also have research value.
References
- Alanyali, M., Moat, H. & Preis, T. Quantifying the Relationship Between Financial News and the Stock Market. Sci Rep 3, 3578 (2013). https://doi.org/10.1038/srep03578.
- D. D. Wu, L. Zheng and D. L. Olson. A Decision Support Approach for Online Stock Forum Sentiment Analysis, in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 44, no. 8, pp. 1077-1087, Aug. 2014, doi: 10.1109/TSMC.2013.2295353.
- M. S. Neethu and R. Rajasree. Sentiment analysis in twitter using machine learning techniques, 2013 Fourth International Conference on Computing, Communications and Networking Technologies (ICCCNT), Tiruchengode, India, 2013, pp. 1-5. doi: 10.1109/ICCCNT.2013.6726818.
- Shiyang Liao, Junbo Wang, Ruiyun Yu, Koichi Sato, Zixue Cheng. CNN for situations understanding based on sentiment analysis of twitter data, Procedia Computer Science, Volume 111, 2017, pp. 376-381, https://doi.org/10.1016/j.procs.2017.06.037.
- R. Monika, S. Deivalakshmi and B. Janet. Sentiment Analysis of US Airlines Tweets Using LSTM/RNN, 2019 IEEE 9th International Conference on Advanced Computing (IACC), Tiruchirappalli, India, 2019, pp. 92-95, doi: 10.1109/IACC48062.2019.8971592.
- Devlin, Jacob, et al. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018).
- M. G. Sousa, K. Sakiyama, L. d. S. Rodrigues, P. H. Moraes, E. R. Fernandes and E. T. Matsubara, BERT for Stock Market Sentiment Analysis, 2019 IEEE 31st International Conference on Tools with Artificial Intelligence (ICTAI), Portland, OR, USA, 2019, pp. 1597-1601, doi: 10.1109/ICTAI.2019.00231.
- Zhao R., Deng Y., Dredze M., Verma A., Rosenberg D., Stent A. Visual attention model for cross-sectional stock return prediction and end-to-end multimodal market representation learning. InThe Thirty-Second International Flairs Conference, 2019 May 19.
- Sunny M.A., Maswood M.M., Alharbi A.G. Deep learning-based stock price prediction using LSTM and bi-directional LSTM model. In2020 2nd novel intelligent and leading emerging sciences conference (NILES), IEEE. 2020 Oct 24, pp. 87-92.
- Gupta U., Bhattacharjee V., Bishnu P.S. StockNet—GRU based stock index prediction. Expert Systems with Applications. 2022 Nov 30;207:117986.
- Loureiro D., Barbieri F., Neves L., Anke L.E, Camacho-Collados J. TimeLMs: Diachronic language models from Twitter. arXiv preprint arXiv:2202.03829. 2022 Feb 8.
- Salazar J., Liang D., Nguyen T.Q., Kirchhoff K. Masked language model scoring. 2019 Oct 31. arXiv preprint arXiv:1910.14659.
- Chevalier G. LARNN: linear attention recurrent neural network. arXiv preprint arXiv:1808.05578. 2018 Aug 16.
- Li Y.H., Harfiya L.N., Purwandari K., Lin Y.D. Real-time cuffless continuous blood pressure estimation using deep learning model. Sensors. 2020 Sep 30;20(19):5606.
- Bahdanau D, Cho K, Bengio Y. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. 2014 Sep 1.
- Stock Price Prediction Website Using Linear Regression - A Machine Learning Algorithm (Sonali Antad, Saloni Khandelwal, Anushka Khandelwal, Rohan Khandare, Prathamesh Khandave, Dhawal Khangar, Raj Khanke), ITM Web Conf. 56 05016, 2023. DOI: 10.1051/itmconf/20235605016.