kyled commited on
Commit
a0667b7
1 Parent(s): 0885d54

removed initial error from frontend

Browse files
Files changed (1) hide show
  1. app.py +9 -8
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
- candidate_labels = ['anger', 'sadness', 'fear', 'joy', 'interest',
13
- 'surprise', 'disgust', 'shame', 'guilt', 'compassion', 'other']
14
- output = classifier(x, candidate_labels)
15
- st.write(str(output))
 
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)