Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brand Sentiment Analysis using NLP #450

Merged
merged 10 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
508 changes: 508 additions & 0 deletions Brand Sentiment Analysis using NLP/Dataset/Dataset - Test.csv

Large diffs are not rendered by default.

8,782 changes: 8,782 additions & 0 deletions Brand Sentiment Analysis using NLP/Dataset/Dataset - Train.csv

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Brand Sentiment Analysis using NLP/Dataset/Dataset Card.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dataset description,"Users assessed tweets related to various brands and products, providing evaluations on whether the sentiment conveyed was positive, negative, or neutral. Additionally, if the tweet conveyed any sentiment, contributors identified the specific brand or product targeted by that emotion."
Columns,"tweet_text
emotion_in_tweet_is_directed_at
is_there_an_emotion_directed_at_a_brand_or_product"
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.
79 changes: 79 additions & 0 deletions Brand Sentiment Analysis using NLP/models/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
*Brand Sentiment Analysis using NLP*<br>
*🎯 Goal*<br>
The main goal of this project is to perform sentiment analysis on brand-related text data using Natural Language Processing (NLP) techniques. The purpose is to understand the sentiment expressed in textual content related to a brand, which can be valuable for businesses to gauge public opinion and improve their brand perception.<br>

*🧵 Dataset*<br>
The dataset used in this project is sourced from https://www.kaggle.com/datasets/tusharpaul2001/brand-sentiment-analysis-dataset . It comprises user-generated reviews and sentiments related to various brands. The dataset includes columns such as 'Brand', 'Category', 'Tweet', and 'Sentiment', providing a diverse set of textual data for sentiment analysis.<br>
<br>

*🧾 Description*<br>
This project utilizes LSTM and BERT models for brand sentiment analysis. The LSTM model captures sequential patterns in the text, while the BERT model leverages contextual embeddings for more accurate sentiment analysis.<br>
<br>

*🧮 What I had done!*<br>
1. Data Preprocessing:<br>

Text cleaning and tokenization.<br>
Handling missing or irrelevant data.<br>

1. Feature Engineering:<bt>
Word embeddings for LSTM.<br>
Token embeddings for BERT.<br>

3. Model Training:<br>
Training the LSTM model on preprocessed text data.<br>
Fine-tuning the BERT model on the specific sentiment analysis task.<br>

4. Model Evaluation:<br>

Evaluating models on test data.<br>
Comparing the performance of LSTM and BERT models.<br>
<br>

*🚀 Models Implemented*<br>
Long Short-Term Memory (LSTM) model<br>
BERT (Bidirectional Encoder Representations from Transformers) model<br>

Why these models:<br>

LSTM: Suitable for capturing sequential patterns in text data.<br>
BERT: Utilizes contextual embeddings, providing a deeper understanding of language context.<br>
<br>


*📚 Libraries Needed*<br>
1. Tensorflow
2. Keras
3. Hugging Face Transformers
4. Pandas
5. Numpy
6. Matplotlib
7. Seaborn

<br>

*📊 Exploratory Data Analysis Results*<br>

Sentiment Distribution<br>

Insight: The distribution of sentiments across the dataset showcases the balance or imbalance between positive, negative, and neutral sentiments, guiding the model training process.<br>

Brand-wise Sentiment Analysis<br>

Insight: Analyzing sentiments specific to each brand reveals patterns and helps understand how different brands are perceived by users. This information is valuable for businesses aiming to enhance their brand image.<br>
Feel free to replace the placeholder text with actual links to your visualizations or images and provide specific insights derived from your EDA. Including visuals helps make your README more engaging and informative.<br>
<br>

*📈 Performance of the Models based on Accuracy Scores*<br>
1. LSTM Model Accuracy: 82.54%<br>
2. BERT Model Accuracy: 81.18%<br>


*📢 Conclusion*<br>
The brand sentiment analysis project demonstrates the effectiveness of both LSTM and BERT models. While LSTM captures sequential nuances, BERT provides contextual understanding, resulting in improved sentiment analysis. The LSTM model achieved an accuracy of 82.54%, making it a valuable tool for brand perception analysis.<br>

<br>

✒️ Your Signature<br>
Dipayan Majumder<br>
https://github.com/dipayan22/<br>
Loading