-
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from Shobhit-Bandhu/stock-news-sentiment-anal…
…ysis Stock News Sentiment Analysis
- Loading branch information
Showing
8 changed files
with
114,347 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Dataset: | ||
https://www.kaggle.com/datasets/avisheksood/stock-news-sentiment-analysismassive-dataset | ||
|
||
# Columns: | ||
Sentiment: 0 represents a negative/neutral sentiment and 1 represents a positive sentiment. | ||
|
||
Sentence: The text upon which sentiment analysis is to be performed. | ||
|
||
# About this file: | ||
0 represents that the news is negative or neutral (Therefore the stock will likely go down) | ||
1 represents that the news is positive (Therefore the likely stock will go up) |
110,736 changes: 110,736 additions & 0 deletions
110,736
Stock News Sentiment Analysis/Dataset/Sentiment_Stock_data.csv
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Stock News Sentiment Analysis | ||
|
||
**PROJECT TITLE** | ||
|
||
**GOAL** | ||
|
||
The goal is to perform sentiment analysis on stock market news. It is a binary classification problem, where | ||
- label==1 signifies positive sentiment, and, | ||
- label==0 signifies neutral or negative sentiment. | ||
|
||
**DATASET** | ||
|
||
https://www.kaggle.com/datasets/avisheksood/stock-news-sentiment-analysismassive-dataset | ||
|
||
**DESCRIPTION** | ||
|
||
|
||
|
||
**WHAT HAVE I DONE** | ||
|
||
- Removed stopwords, punctuations, made text lowercase, and lemmatized text to base form. | ||
- Made WordClouds for: | ||
- The entire dataset | ||
- Words featured in positive sentiments | ||
- Words featured in negative sentiments | ||
- Vectorized text using TF-IDF vectorizer | ||
- Applied classification on a dataset with: | ||
- Parameter: TF-IDF vectors | ||
- Label: Encoded sentiment | ||
|
||
**MODELS USED** | ||
|
||
Classification algorithms like: | ||
- Logistic regression | ||
- Naive-Bayes classifier | ||
- SVM classifier | ||
- Random Forest Regressor | ||
|
||
**LIBRARIES NEEDED** | ||
|
||
- numpy | ||
- pandas | ||
- matplotlib | ||
- nltk | ||
- textblob | ||
- wordcloud | ||
- sklearn | ||
- tensorflow | ||
|
||
**VISUALIZATION** | ||
- Sentiment distribution (1 and 0) | ||
![Alt text](../Images/Sentiment_distribution.png) | ||
- WordCloud for overall dataset | ||
![Alt text](../Images/WordCloud.png) | ||
- WordCloud for negative sentiment text only | ||
![Alt text](../Images/WordCloud_negative.png) | ||
- WordCloud for positive sentiment text only | ||
![Alt text](../Images/WordCloud_positive.png) | ||
|
||
**ACCURACIES** | ||
|
||
Ranking models based on accuracy: | ||
|
||
- DistilBert: 54.70% | ||
- Naive-Bayes: 54.42% | ||
- SVM: 53.67% | ||
- Random Forest Classifier: 53.86% | ||
- Logistic Regression: 53.17% | ||
|
||
|
||
**CONCLUSION** | ||
|
||
All used models give a similar performance while using TF-IDF vectorization. | ||
|
||
**YOUR NAME** | ||
|
||
- Name: Shobhit Bandhu | ||
- College: JU B.Prod '27 | ||
- LinkedIn: https://www.linkedin.com/in/shobhit-bandhu/ |
Oops, something went wrong.