cx-agent / core /intent.py
yekkala's picture
Create intent.py
d14dfaf verified
raw
history blame
302 Bytes
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]