Loading…
Loading…
This 67M parameter model is a fine-tuned version of bert-base-uncased trained on the Cleanlab Amazon Reviews dataset. It achieves the following results on the evaluation set: Loss: 0.1785 Accuracy: 0.9440
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="profautorino/product-review-sentiment-bert-base-uncased",
)
print(classifier("The headphones sound great and are comfortable to wear."))
For batch inference, pass a list of review strings:
reviews = [
"This product exceeded my expectations!",
"It broke after one day and was a waste of money.",
]
predictions = classifier(reviews, truncation=True)
for review, prediction in zip(reviews, predictions):
print(f"{prediction['label']} ({prediction['score']:.3f}): {review}")
Intended to be used for batch sentiment analysis of product reviews in testing. Use in production is not advised. Use at your own risk.
See Cleanlab/amazon-reviews for details: https://huggingface.co/datasets/Cleanlab/amazon-reviews
The following hyperparameters were used during training:
After quantizing the model from F32 to F16, this model maintains accuracy and produces the following evaluation results:
Split: test; evaluated reviews: 1000
Accuracy: 0.9440
precision recall f1-score support
negative 0.99 0.89 0.93 447
positive 0.91 0.99 0.95 553
accuracy 0.94 1000
macro avg 0.95 0.94 0.94 1000
weighted avg 0.95 0.94 0.94 1000
Confusion matrix (rows=true, columns=predicted): [[396 51] [ 5 548]]
google-bert/bert-base-uncased