Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 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 |
|