nyu-mll/glue
Viewer • Updated • 1.49M • 463k • 495
This model is a fine-tuned version of bert-base-uncased on the GLUE SST-2 dataset for sentiment classification (positive vs. negative).
On the SST-2 validation set:
| Epoch | Training Loss | Validation Loss | Accuracy |
|---|---|---|---|
| 1 | 0.1761 | 0.2282 | 93.0% |
| 2 | 0.1127 | 0.2701 | 93.1% |
Final averaged training loss: 0.1663
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_name = "ByteMeHarder-404/bert-base-uncased-finetuned-sst2"
tok = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
inputs = tok("I love Hugging Face!", return_tensors="pt")
outputs = model(**inputs)
pred = outputs.logits.argmax(dim=-1).item()
print("Label:", pred) # 1 = Positive