Skip to content

Sentiment analysis using the distilbert-base-uncased model using the movies dataset.

License

Notifications You must be signed in to change notification settings

abhiverse01/SentimentAnalysis-DistilBERT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

SentimentAnalysis-DistilBERT

Sentiment Analysis with DistilBERT

This repository contains a Jupyter Notebook for performing sentiment analysis using the DistilBERT model. The notebook demonstrates the process of fine-tuning DistilBERT for text classification tasks, specifically for sentiment analysis.

Project Overview

Sentiment analysis is a common task in natural language processing (NLP) where the goal is to determine the sentiment expressed in a piece of text. This notebook leverages the pre-trained DistilBERT model, which is a smaller, faster, and lighter version of BERT (Bidirectional Encoder Representations from Transformers).

Notebook Contents

The notebook includes the following sections:

  1. Introduction: Brief overview of the project and objectives.
  2. Setup: Installation and import of necessary libraries and packages.
  3. Data Loading and Preprocessing: Loading the dataset and preprocessing the text data for model training.
  4. Model Setup: Initializing the DistilBERT model and preparing it for fine-tuning.
  5. Training: Fine-tuning the DistilBERT model on the sentiment analysis dataset.
  6. Evaluation: Evaluating the performance of the model on the validation/test dataset.
  7. Inference: Making predictions on new text data using the trained model.

How to Use

To run the notebook, you can use the following Google Colab link:

Open In Colab

Prerequisites

  • Python 3.x
  • Jupyter Notebook
  • Required Python packages (can be installed via requirements.txt if provided)

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/sentiment-analysis-distilbert.git
    cd sentiment-analysis-distilbert
  2. Install the required packages:

git clone https://github.com/yourusername/sentiment-analysis-distilbert.git
cd sentiment-analysis-distilbert
  1. Running the Notebook
  • Open the notebook:
    jupyter notebook distilbert_base_uncased_new_lora_text_classification.ipynb
  • Follow the instructions in the notebook to run each cell and perform sentiment analysis.

Results

  • After fine-tuning the model, you will be able to evaluate its performance on the test dataset. The notebook provides various evaluation metrics such as accuracy, precision, recall, and F1 score.

Contributing

  • If you would like to contribute to this project, please fork the repository and create a pull request with your changes. Contributions are welcome!

License

  • This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Hugging Face for providing the pre-trained DistilBERT model and the transformers library. Google Colab for providing a free and convenient environment for running Jupyter Notebooks.

About

Sentiment analysis using the distilbert-base-uncased model using the movies dataset.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published