Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,14 +69,14 @@ if st.button('Submit'):
|
|
| 69 |
number = predictions[0].cpu().detach().numpy()
|
| 70 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
| 71 |
|
| 72 |
-
fig = plt.figure(figsize=(10,
|
| 73 |
ax = fig.add_axes([0,0,1,1])
|
| 74 |
labels_plot = ['Binnenland', 'Buitenland' ,'Cultuur & Media' ,'Economie' ,'Koningshuis',
|
| 75 |
'Opmerkelijk' ,'Politiek', 'Regionaal nieuws', 'Tech']
|
| 76 |
probs_plot = probabilities[0].cpu().detach().numpy()*100
|
| 77 |
|
| 78 |
ax.barh(labels_plot,probs_plot)
|
| 79 |
-
ax.set_title("Predicted article category probability")
|
| 80 |
ax.set_xlabel("Probability")
|
| 81 |
ax.set_ylabel("Predicted category")
|
| 82 |
st.pyplot(fig)
|
|
|
|
| 69 |
number = predictions[0].cpu().detach().numpy()
|
| 70 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
| 71 |
|
| 72 |
+
fig = plt.figure(figsize=(10,4))
|
| 73 |
ax = fig.add_axes([0,0,1,1])
|
| 74 |
labels_plot = ['Binnenland', 'Buitenland' ,'Cultuur & Media' ,'Economie' ,'Koningshuis',
|
| 75 |
'Opmerkelijk' ,'Politiek', 'Regionaal nieuws', 'Tech']
|
| 76 |
probs_plot = probabilities[0].cpu().detach().numpy()*100
|
| 77 |
|
| 78 |
ax.barh(labels_plot,probs_plot)
|
| 79 |
+
ax.set_title("Predicted article category probability", fontsize=20)
|
| 80 |
ax.set_xlabel("Probability")
|
| 81 |
ax.set_ylabel("Predicted category")
|
| 82 |
st.pyplot(fig)
|