Downloads · 30 days
8
24% of all-time downloads
AventIQ-AI/sentiment_analysis_product_review_sentiment
sentiment_analysis_product_review_sentiment is a machine learning model from AventIQ-AI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A BERT-based sentiment analysis model fine-tuned on the TweetEval dataset. It predicts the sentiment of a text as Positive, Neutral, or Negative with confidence scores. This model is useful for classifying product fee…
Downloads · 30 days
8
24% of all-time downloads
All-time downloads
33
Public
Parameters
109M
219 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors219 MB · 100%
From the Hugging Face model README
A BERT-based sentiment analysis model fine-tuned on the TweetEval dataset. It predicts the sentiment of a text as Positive, Neutral, or Negative with confidence scores. This model is useful for classifying product feedback, user reviews, or social media posts.
bert-base-uncased (by Google)bert-base-uncased| Metric | Score |
|---|---|
| Accuracy | 0.99 |
| F1-macro | 0.98 |
Replace the above with actual scores after evaluation.
| Label ID | Sentiment |
|---|---|
| 0 | Negative |
| 1 | Neutral |
| 2 | Positive |
from transformers import BertTokenizer, BertForSequenceClassification
import torch
import torch.nn.functional as F
model_name = "AventIQ-AI/sentiment_analysis_product_review_sentiment"
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertForSequenceClassification.from_pretrained(model_name)
model.eval()
def predict(text):
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
probs = F.softmax(outputs.logits, dim=1)
pred = torch.argmax(probs, dim=1).item()
label_map = {0: "Negative", 1: "Neutral", 2: "Positive"}
return f"Sentiment: {label_map[pred]} (Confidence: {probs[0][pred]:.2f})"
# Test predictions
print("\nTest Predictions:")
print(predict("We're thrilled to announce our latest update, packed with new features and performance improvements!"))
Post-training quantization was applied using PyTorch's built-in quantization framework to reduce the model size and improve inference efficiency.
.
├── model/ # Contains the quantized model files
├── tokenizer_config/ # Tokenizer configuration and vocabulary files
├── model.safensors/ # Fine Tuned Model
├── README.md # Model documentation
Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements.