ashrestha commited on
Commit
2d6cd9e
1 Parent(s): e6c3137

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -19,9 +19,12 @@ if submit_button:
19
  pred = classifier(input_text, labels, multi_class=input_multi)
20
 
21
  if input_multi:
22
- st.vega_lite_chart(pred,
23
- {'mark': 'bar', 'encoding': {'y': 'labels', 'x': 'scores'}}
24
- )
 
 
 
25
  else:
26
  out = f"Top predicted labels are {', '.join(p for p in pred['labels'][0:2])}"
27
 
 
19
  pred = classifier(input_text, labels, multi_class=input_multi)
20
 
21
  if input_multi:
22
+ st.vega_lite_chart(pred, {'mark': {'type': 'bar', 'tooltip': False},
23
+ 'encoding': {
24
+ 'x': {'field': 'scores', 'type': 'quantitative'},
25
+ 'y': {'field': 'labels', 'type': 'nominal'},
26
+ })
27
+ }
28
  else:
29
  out = f"Top predicted labels are {', '.join(p for p in pred['labels'][0:2])}"
30