BaşlayınÜcretsiz Başlayın

Zero-shot classification of support tickets

A company receives hundreds of support tickets daily, covering topics like billing issues, technical problems, and account management. Manually sorting these tickets is inefficient. You've been asked to use a zero-shot classification model to automatically categorize incoming ticket messages without needing a custom-trained classifier.

Bu egzersiz

Natural Language Processing (NLP) in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a zero-shot classifier pipeline using the "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli" model.
  • Use it to classify the ticket_text into one of the categories listed in candidate_labels.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

from transformers import pipeline

# Initialize the zero-shot classifier
classifier = ____

ticket_text = "I was charged twice for my subscription this month. Can you please refund the extra charge?"
candidate_labels = ["Billing", "Technical Issue", "Account Access"]

# Classify the ticket
result = ____

print(result['labels'])
print(result['scores'])
Kodu Düzenle ve Çalıştır