Downloads · 30 days
12
32% of all-time downloads
Arskye/my-sentiment-model
my-sentiment-model is a text classification model from Arskye. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Fine-tuned DistilBERT for 3-class sentiment classification (negative, neutral, positive).
Downloads · 30 days
12
32% of all-time downloads
All-time downloads
38
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
Fine-tuned DistilBERT for 3-class sentiment classification (negative, neutral, positive).
This model is a fine-tuned version of DistilBERT-base-uncased for sentiment analysis. It has been trained to classify text into three sentiment categories:
This model is intended for sentiment analysis tasks on English text. It can be used to:
The model achieves the following performance on the test set:
Install the required dependencies:
pip install transformers torch
Load and use the model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "your-username/my-sentiment-model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Prepare text
text = "I love this product!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
# Get prediction
with torch.no_grad():
outputs = model(**inputs)
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(probabilities, dim=-1).item()
# Map prediction to label
labels = {0: "negative", 1: "neutral", 2: "positive"}
confidence = probabilities[0][predicted_class].item()
print(f"Text: {text}")
print(f"Sentiment: {labels[predicted_class]} (confidence: {confidence:.2%})")
If you use this model in your research, please cite:
@misc{my-sentiment-model,
author = {Your Name},
title = {Fine-tuned DistilBERT for Sentiment Analysis},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/your-username/my-sentiment-model}
}
This model is released under the MIT License.