Model Overview

Figure 1: Confusion matrix for test data image/png

Figure 2: Confusion matrix for validation data image/png

How to Use the Model

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'}")



Downloads last month
213
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ashish-001/Bert-Amazon-review-sentiment-classifier

Finetuned
(4555)
this model

Dataset used to train ashish-001/Bert-Amazon-review-sentiment-classifier

Space using ashish-001/Bert-Amazon-review-sentiment-classifier 1