Spaces:
Runtime error
Runtime error
| from transformers import pipeline | |
| from config import MODEL_NAME, INTENT_LABELS | |
| # Load zero-shot classification pipeline | |
| classifier = pipeline("zero-shot-classification", model=MODEL_NAME) | |
| def classify_conversation(conversation_text): | |
| result = classifier(conversation_text, INTENT_LABELS) | |
| top_label = result['labels'][0] | |
| rationale = f"Conversation was classified as '{top_label}' because the final messages indicate a likely intent of {top_label.lower()}." | |
| return top_label, rationale | |