Get Started
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("Savtale/User-Intention-Recognition")
tokenizer = AutoTokenizer.from_pretrained("Savtale/User-Intention-Recognition")
# User is talking with a chatbot
input_user_text = "Sounds good. I'm interested in trying the free trial. How do I sign up?"
# Tokenizing text
inputs = tokenizer(input_user_text.lower(), return_tensors="pt")
# Predict
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
# Prepare result
probabilities = torch.softmax(logits, dim=-1) # Top Match
predicted_class = int(torch.argmax(probabilities)) # Class no.
str_predicted_class = class_dict[str(predicted_class)] # Class String
print(f"Predicted User Intention: {str_predicted_class}") # Predicted User Intention: Request a Demo
Classes
class_dict = { "0": "Ask For Technical Support", "1": "Ask General Question", "2": "Start Conversation", "3": "Express Dissatisfaction", "4": "Request Product Information", "5": "Inquire About Pricing", "6": "Negotiate Price", "7": "Request Return or Refund", "8": "Provide Positive Feedback", "9": "Provide Negative Feedback", "10": "Seek Recommendation", "11": "Request Customization", "12": "Ask About Shipping and Delivery", "13": "Inquire About Warranty and Support", "14": "Express Interest in Upselling", "15": "Express Interest in Cross-selling", "16": "Request Urgent Assistance", "17": "Ask About Promotions and Discounts", "18": "Inquire About Loyalty Programs", "19": "Request a Callback", "20": "Ask About Payment Options", "21": "Express Uncertainty", "22": "Request Clarification", "23": "Confirm Understanding", "24": "End Conversation", "25": "Express Gratitude", "26": "Apologize", "27": "Complain About Customer Service", "28": "Request a Manager", "29": "Ask About Company Policies", "30": "Inquire About Job Opportunities", "31": "Ask About Corporate Social Responsibility", "32": "Express Interest in Investing", "33": "Cancellation", "34": "Ask About Return Policy", "35": "Inquire About Sustainability Practices", "36": "Request a Catalog", "37": "Ask About Brand History", "38": "Express Interest in Partnership", "39": "Inquire About Franchise Opportunities", "40": "Ask About Corporate Events", "41": "Express Interest in Volunteering", "42": "Request a Referral", "43": "Ask About Gift Cards", "44": "Inquire About Product Availability", "45": "Request a Personalized Recommendation", "46": "Ask About Order Status", "47": "Express Interest in a Webinar or Workshop", "48": "Request a Demo", "49": "Ask About Social Media Channels" }
Authors
- Savta
- Downloads last month
- 30
Model tree for Savtale/User-Intention-Recognition
Base model
google-bert/bert-base-uncased