nyu-mll/glue
Viewer • Updated • 1.49M • 447k • 525
This model is a BERT-base (bert-base-uncased) model fine-tuned on the SST-2 (Stanford Sentiment Treebank) dataset for binary sentiment classification.
The model predicts whether a given English sentence expresses positive or negative sentiment.
This model was fine-tuned as part of a learning-focused, production-style workflow:
0 → Negative1 → PositiveSST-2 consists of movie review sentences annotated for sentiment polarity.
The model was evaluated on the SST-2 validation set.
Expected performance is consistent with standard BERT fine-tuning on SST-2:
This model is intended primarily for learning and demonstration rather than leaderboard optimization.
from transformers import BertTokenizer, BertForSequenceClassification
import torch
tokenizer = BertTokenizer.from_pretrained("VijayKanupuri/bert-sst2")
model = BertForSequenceClassification.from_pretrained("VijayKanupuri/bert-sst2")
text = "I really loved this movie"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
label = torch.argmax(probs, dim=-1).item()
confidence = probs[0][label].item()
print(label, confidence)