Downloads · 30 days
9
7% of all-time downloads
Talip7/bert-base-sst2-finetuned
bert-base-sst2-finetuned is a text classification model from Talip7. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned version of bert-base-uncased on the GLUE SST-2 dataset for binary sentiment analysis.
Downloads · 30 days
9
7% of all-time downloads
All-time downloads
131
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
This model is a fine-tuned version of bert-base-uncased on the GLUE SST-2 dataset for binary sentiment analysis.
The model was evaluated on the SST-2 validation set.
This model can be used for:
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Talip7/bert-base-sst2-finetuned"
)
classifier("I love this project!")
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]}")