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