Dragneel commited on
Commit
79a7804
·
verified ·
1 Parent(s): ac3a8f2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -31
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 DistilBERT for text classification, specifically designed to classify customer support tickets into predefined categories. It has been trained on a dataset of customer inquiries to assist in automating ticket categorization.
8
 
9
- - **Model type:** DistilBERT-based Text Classifier
 
10
  - **Language(s):** English
11
- - **License:** Apache 2.0
12
- - **Finetuned from model:** distilbert-base-uncased
13
-
14
- ### Evaluation Results
15
 
16
- - **eval_loss:** 0.2139
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
- ## Training Details
24
 
25
- ### Training Hyperparameters
26
-
27
- - **Training regime:** fp16 mixed precision
28
- - **Epochs:** 3
29
- - **Batch size:** 2
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
- from transformers import pipeline
 
 
 
38
 
39
- # Load tokenizer and model
40
- tokenizer = AutoTokenizer.from_pretrained("your_username/ticket_classifier")
41
- model = AutoModelForSequenceClassification.from_pretrained("your_username/ticket_classifier")
42
 
43
- # Initialize pipeline
44
- classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
 
45
 
46
- # Classify a sample text
47
- result = classifier("Sample customer support ticket text.")
48
- print(result)
 
 
 
 
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]}")