BERT Base Uncased – Fine-tuned on SST-2

This model is a fine-tuned version of bert-base-uncased on the GLUE SST-2 dataset for binary sentiment analysis.


Model Details

  • Developed by: Talip7
  • Base model: BERT Base Uncased
  • Model type: Transformer encoder (BERT)
  • Language: English
  • Task: Sentiment Analysis (Binary Classification)

Training Details

  • Dataset: GLUE / SST-2
  • Training framework: PyTorch
  • Libraries: πŸ€— Transformers, πŸ€— Datasets, πŸ€— Accelerate
  • Optimizer: AdamW
  • Learning rate: 3e-5
  • Epochs: 3
  • Learning rate scheduler: Linear
  • Hardware: GPU (via πŸ€— Accelerate)

Evaluation Results

The model was evaluated on the SST-2 validation set.

  • Accuracy: 0.9289 (92.89%)

Intended Use

This model can be used for:

  • Binary sentiment analysis on English text
  • Educational purposes (learning fine-tuning with Hugging Face)
  • Benchmarking sentiment classification models

Limitations

  • Trained only on movie reviews (SST-2); performance may degrade on other domains.
  • Does not explicitly handle sarcasm or complex sentiment.
  • Not suitable for multilingual sentiment analysis.

Usage

πŸ€— Transformers Pipeline

from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="Talip7/bert-base-sst2-finetuned"
)

classifier("I love this project!")

πŸ”₯ PyTorch Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("Talip7/bert-base-sst2-finetuned")
model = AutoModelForSequenceClassification.from_pretrained("Talip7/bert-base-sst2-finetuned")

text = "This movie was absolutely fantastic!"

inputs = tokenizer(text, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

logits = outputs.logits
prediction = torch.argmax(logits, dim=-1).item()

label_map = {0: "Negative", 1: "Positive"}
print(f"Prediction: {label_map[prediction]}")
Downloads last month
3
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Datasets used to train Talip7/bert-base-sst2-finetuned