Computer Engineering and Applications ›› 2024, Vol. 60 ›› Issue (12): 314-324.DOI: 10.3778/j.issn.1002-8331.2306-0418

• Engineering and Applications • Previous Articles     Next Articles

Stock Price Prediction Method by Fusing  Sentiment Analysis and GAN-TrellisNet

GE Yebo, LIU Wenjie, GU Yuchen   

  1. 1.School of Software, Nanjing University of Information Science and Technology, Nanjing 210044, China
    2.Engineering Research Center of Digital Forensics, Ministry of Education, Nanjing University of Information Science and Technology, Nanjing 210044, China
  • Online:2024-06-15 Published:2024-06-14

融合情感分析和GAN-TrellisNet的股价预测方法

葛业波,刘文杰,顾雨晨   

  1. 1.南京信息工程大学 软件学院,南京 210044
    2.南京信息工程大学 数字取证教育部工程研究中心,南京 210044

Abstract: Applying time series neural networks to stock price prediction, has become one of the important applications in the quantitative finance field. Time sequence neural networks have excellent ability to capture sequence data and learning memory, and have certain applicability in stock prediction. However, most existing models have problems such as low prediction accuracy and long training time due to complex model structures. In order to solve these problems, a stock prediction method based on sentiment analysis and GAN-TrellisNet is proposed. Firstly, a sentiment analysis model based on LSTM-CNN is proposed to analyze stock comments obtained from financial forums crawled by spiders, and obtain stock sentiment index. In order to improve prediction accuracy, the sentiment index and Baidu search index are added to the stock trading data as the training set. An improved GAN stock price prediction model based on TrellisNet and CNN is proposed, using the convolution characteristics of the TrellisNet generator to capture the local features of the data, and selecting CNN with strong feature extraction ability as a discriminator to distinguish between predicted results and real stock prices. The algorithm is verified by selecting data from 10 representative stocks and 3 stock indices in different periods. The result shows that compared with ConvLSTM and GAN-LSTM prediction models, the GAN-TrellisNet model can effectively shorten training time and improve prediction accuracy.

Key words: quantitative finance, stock price prediction, sentiment analysis, Baidu index, generative adversarial network(GAN), TrellisNet

摘要: 将时序深度神经网络应用于股票价格预测,已成为量化金融领域的重要研究方向。时序神经网络具有很好的序列数据捕捉能力和学习记忆能力,在股票预测上有一定适用性。但是现有的模型大多存在预测准确度不高、模型结构复杂导致训练时间较长等问题. 为了解决以上问题,提出了一种基于情感分析和GAN-TrellisNet的股价预测方法。提出了一个基于LSTM-CNN的情感分析模型,用于分析爬虫获取的主流金融论坛股票评论,并获得股票情感指数。为了提高预测准确度,将情感指数和百度搜索指数加入股票交易数据中作为训练集,提出了一个基于TrellisNet和CNN的改进型GAN股价预测模型,利用TrellisNet生成器的卷积特性来捕捉数据的局部特征,选取特征提取能力较强的CNN作为判别器来区别预测结果和真实股价。通过选取10只代表性股票和三种大盘指数的不同时段数据进行算法验证,结果表明,与ConvLSTM和GAN-LSTM预测模型相比,GAN-TrellisNet模型能有效缩短训练时间,提高预测准确率。

关键词: 量化金融, 股价预测, 情感分析, 百度指数, 生成对抗网络, TrellisNet