Downloads · 30 days
14
42% of all-time downloads
ashaduzzaman/imdb-distilbert-funetuned
imdb-distilbert-funetuned is a text classification model from ashaduzzaman. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
14
42% of all-time downloads
All-time downloads
33
Public
Parameters
67M
536 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This is a fine-tuned version of DistilBERT for sentiment analysis on the IMDb movie review dataset. DistilBERT is a smaller, faster, and lighter variant of BERT, designed to perform efficiently while retaining the core strengths of BERT in natural language understanding.
The model is trained to classify movie reviews as either positive or negative sentiments, making it ideal for applications where sentiment analysis is needed, such as analyzing customer feedback, social media posts, or reviews.
This model is intended for text classification tasks, specifically sentiment analysis. It can be used to automatically label a piece of text as either having a positive or negative sentiment.
Here is how you can use this model with the Hugging Face transformers library:
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
import torch
# Load the model and tokenizer
model_name = "Ashaduzzaman/imdb-distilbert-funetuned",
tokenizer = DistilBertTokenizer.from_pretrained(model_name)
model = DistilBertForSequenceClassification.from_pretrained(model_name)
# Example text
text = "The movie was absolutely fantastic! The acting was superb and the story was gripping."
# Tokenize and predict
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predictions = torch.softmax(logits, dim=1)
# Get the predicted label
predicted_label = torch.argmax(predictions).item()
labels = ["Negative", "Positive"]
print(f"Predicted sentiment: {labels[predicted_label]}")
This model was trained on the IMDb movie review dataset, a large dataset for binary sentiment classification. The dataset contains 50,000 highly polarized movie reviews. This dataset is balanced, with 25,000 positive and 25,000 negative reviews.
The model was fine-tuned using the IMDb dataset with the following configuration:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.2239 | 1.0 | 1563 | 0.2026 | 0.9227 |
| 0.1468 | 2.0 | 3126 | 0.2319 | 0.9320 |