[Paper Review] Sentiment Analysis of Twitter Data for Predicting Stock Market Movements
This paper proposes a machine learning approach to predict stock market movements by analyzing public sentiment in Twitter data using Word2vec and N-gram textual representations. It demonstrates a strong correlation between aggregated tweet sentiment over three-day windows and next-day stock price changes, achieving 71.82% accuracy with LibSVM, showing sentiment from social media can effectively forecast market trends.
Predicting stock market movements is a well-known problem of interest. Now-a-days social media is perfectly representing the public sentiment and opinion about current events. Especially, twitter has attracted a lot of attention from researchers for studying the public sentiments. Stock market prediction on the basis of public sentiments expressed on twitter has been an intriguing field of research. Previous studies have concluded that the aggregate public mood collected from twitter may well be correlated with Dow Jones Industrial Average Index (DJIA). The thesis of this work is to observe how well the changes in stock prices of a company, the rises and falls, are correlated with the public opinions being expressed in tweets about that company. Understanding author's opinion from a piece of text is the objective of sentiment analysis. The present paper have employed two different textual representations, Word2vec and N-gram, for analyzing the public sentiments in tweets. In this paper, we have applied sentiment analysis and supervised machine learning principles to the tweets extracted from twitter and analyze the correlation between stock market movements of a company and sentiments in tweets. In an elaborate way, positive news and tweets in social media about a company would definitely encourage people to invest in the stocks of that company and as a result the stock price of that company would increase. At the end of the paper, it is shown that a strong correlation exists between the rise and falls in stock prices with the public sentiments in tweets.
Motivation & Objective
- To investigate the correlation between public sentiment expressed in Twitter tweets and subsequent stock price movements.
- To develop a robust sentiment analyzer capable of accurately classifying short-form text (tweets) into positive, negative, or neutral sentiment.
- To evaluate whether aggregated sentiment over time can predict directional changes (rise/fall) in stock prices with higher accuracy than random chance.
- To compare the performance of two textual representation techniques—Word2vec and N-gram—in sentiment classification for financial prediction tasks.
Proposed method
- Collected Twitter data related to specific companies using keywords and APIs, focusing on public sentiment about those stocks.
- Preprocessed tweets by removing noise (e.g., URLs, mentions) and applied two textual representation methods: Word2vec embeddings and N-gram feature extraction.
- Trained multiple supervised machine learning classifiers (e.g., Random Forest, Logistic Regression, LibSVM) on labeled sentiment data to classify tweets into positive, negative, or neutral categories.
- Aggregated sentiment scores (positive, negative, neutral counts) over three-day rolling windows as input features for predicting next-day stock price direction (1 = increase, 0 = decrease).
- Split the dataset into 80% training and 20% testing sets, using Weka for model training and evaluation with standard metrics including accuracy, precision, recall, and F-measure.
- Evaluated model performance using ROC curves and compared results across different algorithms and feature representations to identify optimal configurations.
Experimental results
Research questions
- RQ1Is there a statistically significant correlation between public sentiment in Twitter tweets and subsequent stock price movements?
- RQ2How well can Word2vec and N-gram representations classify sentiment in short, informal text like tweets compared to human-annotated labels?
- RQ3Can aggregated sentiment scores over a three-day window predict the direction of next-day stock price changes with meaningful accuracy?
- RQ4Which machine learning algorithm performs best in predicting stock price direction when trained on sentiment features derived from Twitter data?
Key findings
- The sentiment analyzer achieved 70.5% accuracy using N-gram features and 70.2% using Word2vec features, both exceeding the typical human agreement range (70–79%) for sentiment classification on short texts.
- Word2vec-based models were preferred for scalability and semantic consistency, especially with larger datasets, despite slightly lower accuracy than N-grams.
- A classifier trained on three-day aggregated sentiment features achieved 69.01% accuracy using Logistic Regression and 71.82% accuracy with LibSVM, indicating strong predictive power.
- The results show a significant correlation between public sentiment trends on Twitter and actual stock price movements, supporting the hypothesis that social media sentiment can forecast market direction.
- Model performance improved with larger training data, suggesting that expanding the annotated dataset beyond 3,216 tweets could further enhance predictive accuracy.
- The study confirms that positive public sentiment on Twitter about a company is associated with subsequent stock price increases, validating the core premise of sentiment-driven market prediction.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.