Downloads · 30 days
12
1% of all-time downloads
ashish-001/Bert-Amazon-review-sentiment-classifier
Bert-Amazon-review-sentiment-classifier is a text classification model from ashish-001. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
- Base Model: google-bert/bert-base-uncased - Dataset: SetFit/amazonreviewsmultien, - Classes: Binary classification (Positive, Negative) - Performance: - Test Accuracy: 89%
Downloads · 30 days
12
1% of all-time downloads
All-time downloads
1.4K
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
Positive, Negative)Figure 1: Confusion matrix for test data

Figure 2: Confusion matrix for validation data

Below is an example of how to load and use the model for sentiment classification:
from transformers import BertTokenizer, BertForSequenceClassification
import torch
# Load the tokenizer and model
tokenizer = BertTokenizer.from_pretrained(
"ashish-001/Bert-Amazon-review-sentiment-classifier")
model = BertForSequenceClassification.from_pretrained(
"ashish-001/Bert-Amazon-review-sentiment-classifier")
# Example usage
text = "This product is amazing!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
sentiment = torch.argmax(logits, dim=1).item()
print(f"Predicted sentiment: {'Positive' if sentiment else 'Negative'}")