Spaces:
Runtime error
Runtime error
digitalWestie
commited on
Commit
•
9a248a5
1
Parent(s):
60929e9
gfix
Browse files
app.py
CHANGED
@@ -31,8 +31,8 @@ with st.spinner("Loading model..."):
|
|
31 |
|
32 |
if (submit and len(text.strip()) > 0) or len(text.strip()) > 0:
|
33 |
prediction = pipe(text)[0]
|
34 |
-
|
35 |
-
max_ylim =
|
36 |
fig, ax = plt.subplots()
|
37 |
ax.barh([p['label'] for p in prediction], [p['score'] for p in prediction])
|
38 |
#ax.tick_params(rotation=0)
|
|
|
31 |
|
32 |
if (submit and len(text.strip()) > 0) or len(text.strip()) > 0:
|
33 |
prediction = pipe(text)[0]
|
34 |
+
sorted_p = sort_predictions(prediction)
|
35 |
+
max_ylim = sorted_p[0]['score'] + 0.1
|
36 |
fig, ax = plt.subplots()
|
37 |
ax.barh([p['label'] for p in prediction], [p['score'] for p in prediction])
|
38 |
#ax.tick_params(rotation=0)
|