| With the development of economy,people’s quality of life gradually improves,more and more people begin to enter the financial market.As an important part of the financial market,the securities market has attracted much attention of the relevant researchers and investors because of its high returns and high risks.In recent years,deep learning technology has made a breakthrough in natural language processing,image recognition and other fields.Deep learning technology is gradually applied to other fields,stock forecasting is one of them.Stock market prediction is the prediction of stock price trend,which is usually regarded as a time series prediction problem.Long-short-term memory model in deep learning(LSTM)has been used in stock prediction by many researchers in recent years because of its outstanding ability in sequence data processing.The development of natural language processing makes the representation of text data more effective.Therefore,stock news and other data are gradually included in stock forecasting.Considering that LSTM-based stock prediction model can’t deal with the correlation between stocks,this paper introduces self-attention mechanism to construct SALSTM model before LSTM,so that the model has the ability to deal with spatiotemporal dependence and use it in stock prediction.The main contributions of this paper are as follows:Firstly,this article downloaded stock trading data from uqer and used the Scrapy crawler framework to get news data from financial industry websites.For news data,this paper uses BERT to represent its features,and then LSTM processes the sequence of news features to get the synthetical representation of news in the corresponding period.For transaction data,this paper constructs SALSTM which can deal with spatiotemporal dependence by combining self-attention and LSTM,and then uses it to deal with transaction data sequence to obtain comprehensive representation of transaction data in corresponding period.Secondly,after obtaining the comprehensive representation of transaction data and news data,this paper fuse them effectively to get a comprehensive representation for a period of time,and then inputs it into the fully connected network with Sigmoid as the activation function to obtain the predictive value of the rise and fall of many stocks.The experimental results show that the proposed SALSTM model has better performance than the baseline models such as LSTM,TCN,Conv LSTM,etc. |