ilushado commited on
Commit
94303e5
·
1 Parent(s): 72e9f79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -131,10 +131,12 @@ if st.button("Посмотреть топ"):
131
  elems = [el.item() for el in ans[0].argsort(descending=True)[:10]]
132
  probs = ans[0].softmax(dim=0)
133
  str_ans = ''
134
- for el in elems:
135
- str_ans += idx_to_tag[el] + " : " + str(round(probs[el].item(), 2)) + "\n"
136
 
137
- st.write(str_ans)
 
 
 
 
138
 
139
 
140
 
 
131
  elems = [el.item() for el in ans[0].argsort(descending=True)[:10]]
132
  probs = ans[0].softmax(dim=0)
133
  str_ans = ''
 
 
134
 
135
+ st.write(pd.DataFrame({
136
+ 'first column': [idx_to_tag[el] for el in elems],
137
+ 'second column': [round(probs[el].item(), 2) for el in elems],
138
+ }))
139
+
140
 
141
 
142