| With the continuous development of the economy,people are gradually starting to invest and manage their finances.Stock has been regarded as a common way of investment and finance because of its high yield,but it also has the disadvantage of high risk.Therefore,how to effectively predict the future trend of stocks is very important and has become a concern of many investors and researchers.In reality,the trend of stocks is influenced by many factors,including difficult to predict indicators such as financial conditions,balance of payments and inflation.At the same time,the stock data is unstable and non-linear,so how to accurately predict the stock trend is a difficult problem.Nowadays,the following questions often arise in the study of the stock market.With the continuous popularization of the Internet,people begin to express their opinions on stocks on social platforms,which can influence investors’ decisions and thus stock prices.Therefore,it is very necessary to apply investor sentiment data obtained on Internet platforms to stock forecasting.At the same time,although the neural network model can predict the stock index price well,its prediction results are closely related to the selected super parameters,so how to choose the best matching super parameters is crucial to improve the prediction accuracy of the neural network.In addition,time series of different time lines have different explanatory powers to the problem.The short,medium and long-term lines of the stock market will all have an impact on the future trend.Therefore,comprehensive data will be taken into account when predicting the stock price trend.Considering that a single stock has the disadvantage of abnormal fluctuations,this paper chooses the stock index for research,and proposes a multiscale attention mechanism and GA-LSTM model containing sentiment indicators based on the above three aspects.First of all,this paper uses Python to crawl the text data of the stock bar of Orient Wealth Net,marks 500 pieces of data manually,uses the manually marked data to finetune the SKEP model,then uses the fine-tuned SKEP model to classify the text data,and then calculates the sentiment index according to the established calculation rules of investor sentiment index.Secondly,this paper selects the genetic algorithm with global optimal characteristics to optimize the super parameters of long-short term memory network,including time window width,iteration times,neural network layers,etc.,and establishes the GA-LSTM model.Finally,this paper uses the attention to fuse the prediction results of the short,medium and long time lines,and the fused prediction data contains the information of the three time lines.In this paper,the CSI 300 index is selected to verify the model.The verification was carried out through two aspects of intuitive observation prediction chart and evaluation index.Four error functions of mean square error(MSE),root mean square error(RMSE),mean absolute error(MAE)and mean absolute percentage error(MAPE)were selected for evaluation index.The empirical results show that adding emotion index can reduce the prediction error of unoptimized LSTM model;The accuracy of the optimized LSTM model is higher than that of the unoptimized LSTM model.Furthermore,the prediction accuracy of the multi-scale attention mechanism model combining the short,medium and long line GA-LSTM models is better than that of the single time line GA-LSTM model.The empirical results show that the model established in this paper is feasible. |