Downloads · 30 days
23
13% of all-time downloads
andyfe/siena-sentiment
siena-sentiment is a text classification model from andyfe. Use it when you need a label for a piece of text. The card lists the license as mit.
This model is a fine-tuned version of distilbert-base-uncased for sentiment analysis on customer support tickets, capable of classifying text into five sentiment categories.
Downloads · 30 days
23
13% of all-time downloads
All-time downloads
179
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
This model is a fine-tuned version of distilbert-base-uncased for sentiment analysis on customer support tickets, capable of classifying text into five sentiment categories.
The model was trained on 5,000 synthetic customer support tickets:
Here's how to use the model with the Transformers library:
from transformers import pipeline
# Load the sentiment analysis pipeline
classifier = pipeline("text-classification", model="andyfe/siena-sentiment")
# Example text
text = """I am extremely disappointed with the customer service I received today. I've been waiting for a response for over a week, and when I finally got one, it didn't address my issue at all. This is unacceptable."""
# Get prediction
result = classifier(text)
print(result)
For more detailed usage with the model directly:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("andyfe/siena-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("andyfe/siena-sentiment")
# Prepare input text
text = "Your customer service team was incredibly helpful and resolved my issue quickly!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
# Get prediction
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_label = torch.argmax(predictions).item()
# Map prediction to sentiment label
id2label = {
0: "Strong Negative",
1: "Mild Negative",
2: "Neutral",
3: "Mild Positive",
4: "Strong Positive"
}
print(f"Predicted sentiment: {id2label[predicted_label]}")