kyled commited on
Commit
552048c
1 Parent(s): 92518e0

added spinner to frontend

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