Update README.md
Browse files
README.md
CHANGED
@@ -1,48 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Model Card for Ticket Classifier
|
2 |
|
|
|
|
|
3 |
## Model Details
|
4 |
|
5 |
### Model Description
|
6 |
|
7 |
-
This model is a fine-tuned version of
|
8 |
|
9 |
-
- **
|
|
|
10 |
- **Language(s):** English
|
11 |
-
- **License:**
|
12 |
-
- **Finetuned from model:** distilbert-base-uncased
|
13 |
-
|
14 |
-
### Evaluation Results
|
15 |
|
16 |
-
|
17 |
-
- **eval_accuracy:** 95.93%
|
18 |
-
- **eval_runtime:** 99.37 seconds
|
19 |
-
- **eval_samples_per_second:** 3.71
|
20 |
-
- **eval_steps_per_second:** 1.86
|
21 |
-
- **epoch:** 3
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
-
|
28 |
-
-
|
29 |
-
-
|
30 |
-
- **Learning rate:** 2e-5
|
31 |
-
- **Weight decay:** 0.01
|
32 |
-
|
33 |
-
## How to Get Started with the Model
|
34 |
|
35 |
```python
|
36 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
-
# Load
|
40 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
41 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
42 |
|
43 |
-
#
|
44 |
-
|
|
|
45 |
|
46 |
-
#
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- text-classification
|
5 |
+
- customer-support
|
6 |
+
---
|
7 |
+
|
8 |
# Model Card for Ticket Classifier
|
9 |
|
10 |
+
A fine-tuned DistilBERT model that automatically classifies customer support tickets into four categories: Billing Question, Feature Request, General Inquiry, and Technical Issue.
|
11 |
+
|
12 |
## Model Details
|
13 |
|
14 |
### Model Description
|
15 |
|
16 |
+
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.
|
17 |
|
18 |
+
- **Developed by:** [Your Name/Organization]
|
19 |
+
- **Model type:** Text Classification (DistilBERT)
|
20 |
- **Language(s):** English
|
21 |
+
- **License:** [Your License]
|
22 |
+
- **Finetuned from model:** `distilbert-base-uncased`
|
|
|
|
|
23 |
|
24 |
+
## Uses
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
### Direct Use
|
27 |
|
28 |
+
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:
|
29 |
+
- Billing Question (0)
|
30 |
+
- Feature Request (1)
|
31 |
+
- General Inquiry (2)
|
32 |
+
- Technical Issue (3)
|
|
|
|
|
|
|
|
|
33 |
|
34 |
```python
|
35 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
36 |
+
import torch
|
37 |
+
|
38 |
+
# Define class mapping
|
39 |
+
id_to_label = {0: 'Billing Question', 1: 'Feature Request', 2: 'General Inquiry', 3: 'Technical Issue'}
|
40 |
|
41 |
+
# Load model and tokenizer
|
42 |
+
tokenizer = AutoTokenizer.from_pretrained("YOUR_MODEL_PATH")
|
43 |
+
model = AutoModelForSequenceClassification.from_pretrained("YOUR_MODEL_PATH")
|
44 |
|
45 |
+
# Prepare input
|
46 |
+
text = "I was charged twice for my subscription this month"
|
47 |
+
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
|
48 |
|
49 |
+
# Run inference
|
50 |
+
with torch.no_grad():
|
51 |
+
outputs = model(**inputs)
|
52 |
+
prediction = torch.argmax(outputs.logits, dim=1).item()
|
53 |
+
|
54 |
+
print(f"Predicted class: {id_to_label[prediction]}")
|