Savtale commited on
Commit
3a9abff
·
verified ·
1 Parent(s): df77de1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +84 -3
README.md CHANGED
@@ -12,10 +12,91 @@ tags:
12
  ---
13
 
14
  ## Get Started
 
 
 
15
  ```python
16
- Soon...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  ```
18
 
19
- ## Model Card Authors [optional]
20
 
21
- Soon...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
  ## Get Started
15
+
16
+ ### Usage
17
+
18
  ```python
19
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
20
+ import torch
21
+
22
+ model = AutoModelForSequenceClassification.from_pretrained("Savtale/User-Intention-Recognition")
23
+ tokenizer = AutoTokenizer.from_pretrained("Savtale/User-Intention-Recognition")
24
+
25
+ # User is talking with a chatbot
26
+ input_user_text = "Some Text..."
27
+
28
+ # Tokenizing text
29
+ inputs = tokenizer(input_user_text.lower(), return_tensors="pt")
30
+
31
+ # Predict
32
+ with torch.no_grad():
33
+ outputs = model(**inputs)
34
+ logits = outputs.logits
35
+
36
+ # Prepare result
37
+ probabilities = torch.softmax(logits, dim=-1) # Top Match
38
+ predicted_class = int(torch.argmax(probabilities)) # Class no.
39
+ str_predicted_class = class_dict[str(predicted_class)] # Class String
40
+
41
+ print(f"Predicted User Intention: {str_predicted_class}")
42
+
43
  ```
44
 
 
45
 
46
+ ### Classes
47
+ class_dict = {
48
+ "0": "Ask For Technical Support",
49
+ "1": "Ask General Question",
50
+ "2": "Start Conversation",
51
+ "3": "Express Dissatisfaction",
52
+ "4": "Request Product Information",
53
+ "5": "Inquire About Pricing",
54
+ "6": "Negotiate Price",
55
+ "7": "Request Return or Refund",
56
+ "8": "Provide Positive Feedback",
57
+ "9": "Provide Negative Feedback",
58
+ "10": "Seek Recommendation",
59
+ "11": "Request Customization",
60
+ "12": "Ask About Shipping and Delivery",
61
+ "13": "Inquire About Warranty and Support",
62
+ "14": "Express Interest in Upselling",
63
+ "15": "Express Interest in Cross-selling",
64
+ "16": "Request Urgent Assistance",
65
+ "17": "Ask About Promotions and Discounts",
66
+ "18": "Inquire About Loyalty Programs",
67
+ "19": "Request a Callback",
68
+ "20": "Ask About Payment Options",
69
+ "21": "Express Uncertainty",
70
+ "22": "Request Clarification",
71
+ "23": "Confirm Understanding",
72
+ "24": "End Conversation",
73
+ "25": "Express Gratitude",
74
+ "26": "Apologize",
75
+ "27": "Complain About Customer Service",
76
+ "28": "Request a Manager",
77
+ "29": "Ask About Company Policies",
78
+ "30": "Inquire About Job Opportunities",
79
+ "31": "Ask About Corporate Social Responsibility",
80
+ "32": "Express Interest in Investing",
81
+ "33": "Cancellation",
82
+ "34": "Ask About Return Policy",
83
+ "35": "Inquire About Sustainability Practices",
84
+ "36": "Request a Catalog",
85
+ "37": "Ask About Brand History",
86
+ "38": "Express Interest in Partnership",
87
+ "39": "Inquire About Franchise Opportunities",
88
+ "40": "Ask About Corporate Events",
89
+ "41": "Express Interest in Volunteering",
90
+ "42": "Request a Referral",
91
+ "43": "Ask About Gift Cards",
92
+ "44": "Inquire About Product Availability",
93
+ "45": "Request a Personalized Recommendation",
94
+ "46": "Ask About Order Status",
95
+ "47": "Express Interest in a Webinar or Workshop",
96
+ "48": "Request a Demo",
97
+ "49": "Ask About Social Media Channels"
98
+ }
99
+
100
+
101
+ ## Authors
102
+ - Savta