Abstract:The stock price is nonstationary and volatile, the investors are easily influenced by their own sentiments, and their investment decision is irrational. Thus, the stock price is difficult to predict. Aiming at the problem of an unbalanced distribution of text labels in the sentiment analysis method based on the CNN neural network, this paper proposes a stock price prediction method based on sentiment analysis and a generative adversarial network. First, a sentiment dictionary database is established in the financial field. Then, the dictionary-based sentiment analysis method is used to calculate the sentiment polarity of financial text data and the overall sentiment trend of investors every day, that is, the sentiment index. Finally, the generative adversarial network is used to predict the stock market volatility, where the generator generates stock sequence data, and the discriminator uses a convolutional neural network to distinguish the generated data from the real data. This method can dynamically update the prediction results of stocks and obtain smaller error values.