Update app.py
Browse files
app.py
CHANGED
@@ -190,7 +190,7 @@ def classify_text(title, description, show_all=False, threshold=0.95):
|
|
190 |
filtered_results = []
|
191 |
for i in results[0]:
|
192 |
filtered_results.append((i['label'], i['score']))
|
193 |
-
cumulative_prob += score
|
194 |
if cumulative_prob >= threshold:
|
195 |
break
|
196 |
return filtered_results
|
@@ -205,7 +205,7 @@ description = st.text_area("Краткое описание статьи", heigh
|
|
205 |
|
206 |
# Кнопка "Классифицировать"
|
207 |
if st.button("Классифицировать"):
|
208 |
-
if not title
|
209 |
st.warning("Пожалуйста, заполните хотя бы одно поле.")
|
210 |
else:
|
211 |
with st.spinner("Идет классификация..."): # Индикатор загрузки
|
|
|
190 |
filtered_results = []
|
191 |
for i in results[0]:
|
192 |
filtered_results.append((i['label'], i['score']))
|
193 |
+
cumulative_prob += i['score']
|
194 |
if cumulative_prob >= threshold:
|
195 |
break
|
196 |
return filtered_results
|
|
|
205 |
|
206 |
# Кнопка "Классифицировать"
|
207 |
if st.button("Классифицировать"):
|
208 |
+
if not title and not description:
|
209 |
st.warning("Пожалуйста, заполните хотя бы одно поле.")
|
210 |
else:
|
211 |
with st.spinner("Идет классификация..."): # Индикатор загрузки
|