지원 티켓의 Zero-shot 분류
한 회사가 매일 수백 건의 지원 티켓을 받는데, 결제 문제, 기술적 이슈, 계정 관리 등 다양한 주제를 다룹니다. 이 티켓을 수동으로 분류하는 것은 비효율적입니다. 사용자 지정으로 학습한 분류기가 없어도 들어오는 티켓 메시지를 자동으로 분류하도록 zero-shot 분류 모델을 사용해 달라는 요청을 받았습니다.
이 연습은 강의의 일부입니다
Python으로 배우는 Natural Language Processing (NLP)
연습 안내
"MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"모델로 zero-shotclassifier파이프라인을 생성하세요.- 이 파이프라인을 사용해
ticket_text를candidate_labels에 나열된 범주 중 하나로 분류하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
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'])