stanfordnlp/imdb
Viewer • Updated • 100k • 271k • 380
How to use SuganyaP/quick-distilbert-imdb with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="SuganyaP/quick-distilbert-imdb") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("SuganyaP/quick-distilbert-imdb", dtype="auto")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.
The model was evaluated using standard binary classification metrics:
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")
Base model
distilbert/distilbert-base-uncased