Skip to content

Transformer-based sentiment analysis leveraging a BERT architecture for text classification, implemented with PyTorch

License

Notifications You must be signed in to change notification settings

vishalpatel72/BERT-based-Sentiment-Analyzer

Repository files navigation

BERT-based Sentiment Analyzer

A sentiment analysis project leveraging BERT and PyTorch to classify Google Play Store reviews into negative, neutral, and positive sentiments. The dataset is scraped using the google_play_scraper library. Pre-trained model weights are stored externally (Google Drive) due to size constraints.


Project Structure

.
│   README.md
│   LICENSE
│   01_dataset_scraper.ipynb       # Scrape Google Play reviews dataset
│   02_text_preprocessing.ipynb    # Clean & preprocess text
│   03_bert_sentiment_classifier.ipynb  # Train & evaluate the model
│
└───data
│   ├── apps.csv
│   ├── reviews.csv
│
└───models
    ├── model.bin
    ├── model_base_cased_state_842.bin
    ├── model.pth

Usage

  1. Scrape Dataset Run the notebook:

    01_dataset_scraper.ipynb
  2. Preprocess Data Run the notebook:

    02_text_preprocessing.ipynb
  3. Train & Evaluate Model Run the notebook:

    03_bert_sentiment_classifier.ipynb

Model Performance

Label Precision Recall F1-Score Support
Negative 0.83 0.80 0.81 257
Neutral 0.75 0.75 0.75 253
Positive 0.85 0.88 0.86 308
Accuracy - - 0.81 818
Macro Avg 0.81 0.81 0.81 818
Weighted Avg 0.81 0.81 0.81 818

Technologies & Libraries

  • BERT (Hugging Face Transformers)
  • PyTorch
  • Google Play Scraper
  • Pandas, NumPy
  • Scikit-learn

License

This project is licensed under the MIT License.

About

Transformer-based sentiment analysis leveraging a BERT architecture for text classification, implemented with PyTorch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published