Update app.py
Browse files
app.py
CHANGED
@@ -205,15 +205,15 @@ if st.button("Классифицировать"):
|
|
205 |
cumulative_prob = 0
|
206 |
t = 0.95
|
207 |
try:
|
208 |
-
if
|
209 |
-
if (
|
210 |
-
t =
|
211 |
-
elif (
|
212 |
-
t =
|
213 |
except ValueError:
|
214 |
t = 0.95
|
215 |
|
216 |
-
st.subheader(f'Результаты классификации (top {min(t * 100, 100)}%):')
|
217 |
for label, score in results:
|
218 |
st.write(f"- **{label}**: {score:.4f}")
|
219 |
cumulative_prob += score
|
|
|
205 |
cumulative_prob = 0
|
206 |
t = 0.95
|
207 |
try:
|
208 |
+
if float(top):
|
209 |
+
if (float(top) >= 0) and (float(top) <= 1):
|
210 |
+
t = float(top)
|
211 |
+
elif (float(top) > 1):
|
212 |
+
t = float(top) / 100
|
213 |
except ValueError:
|
214 |
t = 0.95
|
215 |
|
216 |
+
st.subheader(f'Результаты классификации (top {int(min(t * 100, 100))}%):')
|
217 |
for label, score in results:
|
218 |
st.write(f"- **{label}**: {score:.4f}")
|
219 |
cumulative_prob += score
|