Update usage.py
Browse files
usage.py
CHANGED
@@ -4,10 +4,8 @@ from transformers import pipeline
|
|
4 |
# Define candidate labels for classification
|
5 |
candidate_labels_spam = ['Spam', 'not Spam']
|
6 |
candidate_labels_urgent = ['Urgent', 'not Urgent']
|
7 |
-
|
8 |
-
model="MoritzLaurer/deberta-v3-large-zeroshot-v1.1-all-33"
|
9 |
model="SpamUrgencyDetection"
|
10 |
-
clf = pipeline("zero-shot-classification", model=model)
|
11 |
def predict(text):
|
12 |
p_spam = clf(text, candidate_labels_spam)["labels"][0]
|
13 |
p_urgent = clf(text, candidate_labels_urgent)["labels"][0]
|
|
|
4 |
# Define candidate labels for classification
|
5 |
candidate_labels_spam = ['Spam', 'not Spam']
|
6 |
candidate_labels_urgent = ['Urgent', 'not Urgent']
|
|
|
|
|
7 |
model="SpamUrgencyDetection"
|
8 |
+
clf = pipeline("zero-shot-classification", model=model) 32
|
9 |
def predict(text):
|
10 |
p_spam = clf(text, candidate_labels_spam)["labels"][0]
|
11 |
p_urgent = clf(text, candidate_labels_urgent)["labels"][0]
|