Spaces:
Runtime error
Runtime error
Update app.py
Browse filesFix syntax error
app.py
CHANGED
@@ -137,10 +137,10 @@ import gradio as grad
|
|
137 |
zero_shot_classifier = pipeline("zero-shot-classification")
|
138 |
|
139 |
def classify(text,labels):
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
txt=grad.Textbox(lines=1, label="English", placeholder="text to be classified")
|
146 |
labels=grad.Textbox(lines=1, label="Labels", placeholder="comma separated labels")
|
|
|
137 |
zero_shot_classifier = pipeline("zero-shot-classification")
|
138 |
|
139 |
def classify(text,labels):
|
140 |
+
classifer_labels = labels.split(",")
|
141 |
+
#["software", "politics", "love", "movies", "emergency", "advertisment","sports"]
|
142 |
+
response = zero_shot_classifier(text,classifer_labels)
|
143 |
+
return response
|
144 |
|
145 |
txt=grad.Textbox(lines=1, label="English", placeholder="text to be classified")
|
146 |
labels=grad.Textbox(lines=1, label="Labels", placeholder="comma separated labels")
|