Downloads · 30 days
4
11% of all-time downloads
Dragneel/Ticket-classification-model
Ticket-classification-model is a text classification model from Dragneel. Use it when you need a label for a piece of text. It is set up for transformers.
A fine-tuned DistilBERT model that automatically classifies customer support tickets into four categories: Billing Question, Feature Request, General Inquiry, and Technical Issue.
Downloads · 30 days
4
11% of all-time downloads
All-time downloads
36
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
A fine-tuned DistilBERT model that automatically classifies customer support tickets into four categories: Billing Question, Feature Request, General Inquiry, and Technical Issue.
This model is a fine-tuned version of distilbert-base-uncased that has been trained to classify customer support tickets into predefined categories. It can help support teams automatically route tickets to the appropriate department.
distilbert-base-uncasedThis model can be directly used to classify incoming customer support tickets. It takes a text description of the customer's issue and classifies it into one of four categories:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Define class mapping
id_to_label = {0: 'Billing Question', 1: 'Feature Request', 2: 'General Inquiry', 3: 'Technical Issue'}
# Load model and tokenizer
YOUR_MODEL_PATH = 'Dragneel/Ticket-classification-model'
tokenizer = AutoTokenizer.from_pretrained("YOUR_MODEL_PATH")
model = AutoModelForSequenceClassification.from_pretrained("YOUR_MODEL_PATH")
# Prepare input
text = "I was charged twice for my subscription this month"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
# Run inference
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print(f"Predicted class: {id_to_label[prediction]}")