Downloads · 30 days
9
13% of all-time downloads
ongaunjie/distilbert-cloths-sentiment
distilbert-cloths-sentiment is a text classification model from ongaunjie. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This Hugging Face repository contains a fine-tuned DistilBERT model for sentiment analysis of women's clothing reviews. The model is designed to classify reviews into positive, negative, or neutral sentiment categorie…
Downloads · 30 days
9
13% of all-time downloads
All-time downloads
69
Public
Repo size
536 MB
Likes
1
Public
Click a slice to open those files.
.bin268 MB · 100%
From the Hugging Face model README
This Hugging Face repository contains a fine-tuned DistilBERT model for sentiment analysis of women's clothing reviews. The model is designed to classify reviews into positive, negative, or neutral sentiment categories, providing valuable insights into customer opinions.
This model was fine-tuned using a relatively small dataset containing 23487 rows broken down into train/eval/test dataset. Nevertheless, the fine-tuned model was able to performs slightly better than the base-distilbert-model on the test dataset.
It achieved the following results on the evaluation set:
| Model | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|
| DistilBERT base model | 0.79 | 0.77 | 0.79 | 0.77 |
| DistilBERT fine-tuned | 0.85 | 0.86 | 0.85 | 0.85 |
To use this model, you'll need to install the Hugging Face Transformers library and any additional dependencies.
You can easily load the pre-trained model for sentiment analysis using Hugging Face's DistilBertForSequenceClassification and DistilBertTokenizerFast.
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
import torch
model_name = "ongaunjie/distilbert-cloths-sentiment"
tokenizer = DistilBertTokenizerFast.from_pretrained(model_name)
model = DistilBertForSequenceClassification.from_pretrained(model_name)
review = "This dress is amazing, I love it!"
inputs = tokenizer.encode(review, return_tensors="pt")
with torch.no_grad():
outputs = model(inputs)
predicted_class = int(torch.argmax(outputs.logits))