Instructions to use Dragneel/Ticket-classification-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dragneel/Ticket-classification-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Dragneel/Ticket-classification-model")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Dragneel/Ticket-classification-model") model = AutoModelForSequenceClassification.from_pretrained("Dragneel/Ticket-classification-model") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| tags: | |
| - text-classification | |
| - customer-support | |
| # Model Card for Ticket Classifier | |
| A fine-tuned DistilBERT model that automatically classifies customer support tickets into four categories: Billing Question, Feature Request, General Inquiry, and Technical Issue. | |
| ## Model Details | |
| ### Model Description | |
| 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. | |
| - **Developed by:** [Your Name/Organization] | |
| - **Model type:** Text Classification (DistilBERT) | |
| - **Language(s):** English | |
| - **License:** [Your License] | |
| - **Finetuned from model:** `distilbert-base-uncased` | |
| ## Uses | |
| ### Direct Use | |
| This 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: | |
| - Billing Question (0) | |
| - Feature Request (1) | |
| - General Inquiry (2) | |
| - Technical Issue (3) | |
| ```python | |
| 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]}") |