Text Classification
Transformers
Safetensors
English
distilbert
sentiment-analysis
car-reviews
text-embeddings-inference
Instructions to use HanfuZhao781/car-review-sentiment-distilbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HanfuZhao781/car-review-sentiment-distilbert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="HanfuZhao781/car-review-sentiment-distilbert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("HanfuZhao781/car-review-sentiment-distilbert") model = AutoModelForSequenceClassification.from_pretrained("HanfuZhao781/car-review-sentiment-distilbert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Car Review Sentiment, DistilBERT
distilbert-base-uncased fine-tuned for 3-class sentiment on real Edmunds car owner reviews, for a per-aspect word-of-mouth analyzer.
- Labels: 0 negative, 1 neutral, 2 positive
- Data: Edmunds consumer car reviews, florentgbelidji/car-reviews, labels by distant supervision from the 1 to 5 star rating.
- Test set of 3,652 held-out reviews: accuracy 86.7 percent, macro-F1 0.566.
- Known limits, measured: negation and sarcasm are hard. See the stress tests in the project repo. Deploy with confidence-gated abstention.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
m = "HanfuZhao781/car-review-sentiment-distilbert"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForSequenceClassification.from_pretrained(m)
x = tok("The engine is powerful but the fuel economy is terrible", return_tensors="pt")
print(model(**x).logits.softmax(-1))
App: https://HanfuZhao781-car-review-sentiment.hf.space Code: https://github.com/hanfuzhao/Module2-CarReviewSentiment
Built for the 540 Summer Module 2 hackathon.
- Downloads last month
- 14
Model tree for HanfuZhao781/car-review-sentiment-distilbert
Base model
distilbert/distilbert-base-uncased