Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2021 Apr 13:7:e476.
doi: 10.7717/peerj-cs.476. eCollection 2021.

Harvesting social media sentiment analysis to enhance stock market prediction using deep learning

Affiliations

Harvesting social media sentiment analysis to enhance stock market prediction using deep learning

Pooja Mehta et al. PeerJ Comput Sci. .

Abstract

Information gathering has become an integral part of assessing people's behaviors and actions. The Internet is used as an online learning site for sharing and exchanging ideas. People can actively give their reviews and recommendations for variety of products and services using popular social sites and personal blogs. Social networking sites, including Twitter, Facebook, and Google+, are examples of the sites used to share opinion. The stock market (SM) is an essential area of the economy and plays a significant role in trade and industry development. Predicting SM movements is a well-known and area of interest to researchers. Social networking perfectly reflects the public's views of current affairs. Financial news stories are thought to have an impact on the return of stock trend prices and many data mining techniques are used address fluctuations in the SM. Machine learning can provide a more accurate and robust approach to handle SM-related predictions. We sought to identify how movements in a company's stock prices correlate with the expressed opinions (sentiments) of the public about that company. We designed and implemented a stock price prediction accuracy tool considering public sentiment apart from other parameters. The proposed algorithm considers public sentiment, opinions, news and historical stock prices to forecast future stock prices. Our experiments were performed using machine-learning and deep-learning methods including Support Vector Machine, MNB classifier, linear regression, Naïve Bayes and Long Short-Term Memory. Our results validate the success of the proposed methodology.

Keywords: Deep learning; LSTM; Machine learning; Sentiment analysis; Stock prediction.

PubMed Disclaimer

Conflict of interest statement

Ketan Kotecha is an Academic Editor for PeerJ Computer Science. The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this article.

Figures

Figure 1
Figure 1. An illustration of how social media and finance news has impact on stock market movements.
Figure 2
Figure 2. Classification techniques of sentiment analysis.
Figure 3
Figure 3. The proposed model to predict stock data using sentiment.
Figure 4
Figure 4. The LSTM model with its three layers.
Figure 5
Figure 5. Stock and news dataset.
Figure 6
Figure 6. Pre-processing phase.
Figure 7
Figure 7. The illustration of the polarity based sentiment classification with several stock news data.
Figure 8
Figure 8. Analysis of BSE sensex opening and closing opening and closing stock price data.
Figure 9
Figure 9. Analysis of opening and closing opening and closing stock price data of the Infosys Company (2014–2018).
Figure 10
Figure 10. Analysis of opening and closing stock price data of Infosys Company (2018–2019).
Figure 11
Figure 11. Time series data analysis of the closing price of Infosys company (2014–2018 ).
Figure 12
Figure 12. The moving average metric prediction representations for BSE sensex (March and April-2020).
Figure 13
Figure 13. Prediction of month wise moving average of stock price using LSTM for BSE sensex.
Figure 14
Figure 14. Prediction of month wise moving average of INFOSYS stock data.

References

    1. Alexander P, Ilya R, Alexey S. Machine learning in prediction of stock market indicators based on historical data and data from Twitter sentiment analysis. IEEE 13th International Conference on Data Mining Workshops.2013.
    1. Awais M, Ghayvat H, Krishnan Pandarathodiyil A, Nabillah Ghani WM, Ramanathan A, Pandya S, Walter N, Saad MN, Zain RB, Faye I. Healthcare professional in the loop (HPIL): classification of standard and oral cancer-causing anomalous regions of oral cavity using textural analysis technique in autofluorescence imaging. Sensors. 2020;20(20):5780. doi: 10.3390/s20205780. - DOI - PMC - PubMed
    1. Barot V, Kapadia V, Pandya S. QoS enabled IoT based low cost air quality monitoring system with power consumption optimization. Cybernetics and Information Technologies. 2020;20(2):122.
    1. Bhuriya D, Girish K, Ashish S, Upendra S. Stock market prediction using a linear regression. International Conference of Electronics, Communication and Aerospace Technology; 2017.
    1. Carosiaa AEO, Coelho GP, Silva AEA. Analyzing the Brazilian financial market through Portuguese sentiment analysis in social media. Applied Artificial Intelligence. 2020;34(1):1–19.

LinkOut - more resources