Skip to content

mhemon/Sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 

Repository files navigation

Sentiment Analysis on Product Reviews using Hugging Face Transformers

This project fine-tunes DistilBERT to perform binary sentiment classification (positive/negative) on the IMDb movie reviews dataset using the Hugging Face transformers and datasets libraries.


πŸ“Œ Features

  • Fine-tunes a pre-trained transformer model on real-world text data.
  • Uses Hugging Face's Trainer API for training and evaluation.
  • Includes accuracy and F1-score metrics.
  • Inference pipeline for testing custom reviews.
  • Fully reproducible in Google Colab.

πŸ“‚ Example Inference

from transformers import pipeline

pipeline = pipeline("text-classification", model="mhemon/seintiment-distilbert-base-uncased", device="cuda")
pipeline("The product quality is amazing and delivery was fast!")
# [{'label': 'POSITIVE', 'score': 0.7757363319396973}]

πŸ“Š Result

Metric Score
Accuracy 0.85
F1 Score 0.85

Colab File

https://colab.research.google.com/drive/1hycSErDqoGt1mWz20Al3fRX6EbDbW2nF?usp=sharing

About

This project fine-tunes DistilBERT to perform binary sentiment classification (positive/negative).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors