Downloads · 30 days
8
4% of all-time downloads
NikkeS/imdb-distilbert
imdb-distilbert is a text classification model from NikkeS. 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.
This model is a fine-tuned version of distilbert-base-uncased on the IMDB movie reviews dataset for binary sentiment classification (positive vs. negative). The model has been trained to classify movie reviews into ei…
Downloads · 30 days
8
4% of all-time downloads
All-time downloads
186
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of distilbert-base-uncased on the IMDB movie reviews dataset for binary sentiment classification (positive vs. negative). The model has been trained to classify movie reviews into either positive (1) or negative (0) sentiments.
distilbert-base-uncasedfrom transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load the fine-tuned model from Hugging Face Hub
model = AutoModelForSequenceClassification.from_pretrained("your-hf-username/imdb-distilbert")
tokenizer = AutoTokenizer.from_pretrained("your-hf-username/imdb-distilbert")
def predict_sentiment(review):
inputs = tokenizer(review, return_tensors="pt", truncation=True, padding=True, max_length=256)
with torch.no_grad():
logits = model(**inputs).logits
prediction = torch.argmax(logits, dim=1).item()
return "Positive" if prediction == 1 else "Negative"
# Example Usage
print(predict_sentiment("This movie was absolutely fantastic!"))
print(predict_sentiment("The acting was terrible, and the story made no sense."))
distilbert-base-uncased tokenizer.5e-5162fp16=True for efficiency)If you use this model, please cite:
@article{salonen2025imdb-distilbert,
title={Fine-tuned DistilBERT for Sentiment Analysis on IMDB Reviews},
author={Nikke Salonen},
year={2025}
}
For questions or issues, contact [email protected].
This model card provides all necessary details, including training info, evaluation results, and usage instructions. Let me know if you'd like any modifications before uploading to Hugging Face Hub!