| from transformers import pipeline | |
| classifier = pipeline( | |
| "zero-shot-classification", | |
| model="facebook/bart-large-mnli" | |
| ) | |
| LABELS = ["Support", "Sales", "Billing", "Complaint", "Feedback", "General"] | |
| def detect_intent(text): | |
| result = classifier(text, LABELS) | |
| return result["labels"][0] | |