Spaces:
Runtime error
Runtime error
added spinner to frontend
Browse files
app.py
CHANGED
@@ -9,12 +9,14 @@ classifier = t.pipeline("zero-shot-classification",
|
|
9 |
multi_class=True)
|
10 |
|
11 |
x = st.text_input("Enter your title here:")
|
|
|
|
|
12 |
|
13 |
if x != "":
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
st.write(str(output))
|
18 |
|
19 |
df = pd.DataFrame(dict(r=output['scores'], theta=output['labels']))
|
20 |
fig = px.line_polar(df, r='r', theta='theta', line_close=True)
|
|
|
9 |
multi_class=True)
|
10 |
|
11 |
x = st.text_input("Enter your title here:")
|
12 |
+
candidate_labels = ['anger', 'sadness', 'fear', 'joy', 'interest',
|
13 |
+
'surprise', 'disgust', 'shame', 'guilt', 'compassion', 'other']
|
14 |
|
15 |
if x != "":
|
16 |
+
|
17 |
+
with st.spinner():
|
18 |
+
output = classifier(x, candidate_labels)
|
19 |
+
# st.write(str(output))
|
20 |
|
21 |
df = pd.DataFrame(dict(r=output['scores'], theta=output['labels']))
|
22 |
fig = px.line_polar(df, r='r', theta='theta', line_close=True)
|