1NEYRON1 commited on
Commit
92458f0
·
1 Parent(s): e96ee03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 or not description:
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("Идет классификация..."): # Индикатор загрузки