DistilBERT IMDB Sentiment Classifier

Overview

This repository contains a fine-tuned DistilBERT model for binary sentiment classification on the IMDB movie reviews dataset. The model predicts whether a given review expresses positive or negative sentiment. It is intended as a lightweight, reproducible NLP model suitable for demonstrations, small-scale applications, and experimentation.

Base Model

  • Model: distilbert-base-uncased
  • Framework: Hugging Face Transformers
  • Task: Text Classification (Binary Sentiment)

Training Details

  • Dataset: IMDB movie review dataset (train/test split)
  • Objective: Binary sentiment classification
  • Optimization:
    • Adam optimizer
    • Learning rate scheduling
    • Early stopping
  • Regularization:
    • Dropout applied as per DistilBERT architecture
    • Gradient clipping

Evaluation Metrics

The model was evaluated using standard binary classification metrics:

  • Accuracy
  • Precision
  • Recall
  • F1-score

Inference Example

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "SuganyaP/quick-distilbert-imdb"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

inputs = tokenizer("This movie was excellent!", return_tensors="pt")
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits).item()

print("Positive" if prediction == 1 else "Negative")
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for SuganyaP/quick-distilbert-imdb

Finetuned
(10966)
this model

Dataset used to train SuganyaP/quick-distilbert-imdb