Downloads · 30 days
9
9% of all-time downloads
nitz0219/bert-movie-review
bert-movie-review is a text classification model from nitz0219. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
A fine-tuned BERT model for binary sentiment classification on movie reviews.
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
99
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
A fine-tuned BERT model for binary sentiment classification on movie reviews.
This project fine-tunes bert-base-uncased on the IMDB movie reviews dataset to classify reviews as Positive or Negative.
model.safetensors — fine-tuned model weightsconfig.json — model configurationtokenizer.json — tokenizertokenizer_config.json — tokenizer configurationpredict.py — inference scriptBERT_transformer_movie_review_project.ipynb — full training notebookfrom transformers import BertTokenizer, BertForSequenceClassification
import torch
model_name = "nitz0219/bert-movie-review"
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertForSequenceClassification.from_pretrained(model_name)
model.eval()
text = "This movie was absolutely fantastic!"
inputs = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1).item()
label = "Positive" if prediction == 1 else "Negative"
print(label)
Nitesh — AI/ML Engineer