Cricles commited on
Commit
0bb3387
·
1 Parent(s): 8fba3f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import base64
3
  import fasttext
 
4
 
5
  st.set_page_config(
6
  page_title="detoxi.ai",
@@ -84,6 +85,9 @@ user_input = st.text_area('',height=200)
84
  if st.button("Проверить текст"):
85
  if user_input.strip():
86
  st.subheader("Результат:")
87
- highlight_obscene_words(user_input)
 
 
 
88
  else:
89
  st.warning("Пожалуйста, введите текст для проверки")
 
1
  import streamlit as st
2
  import base64
3
  import fasttext
4
+ import re
5
 
6
  st.set_page_config(
7
  page_title="detoxi.ai",
 
85
  if st.button("Проверить текст"):
86
  if user_input.strip():
87
  st.subheader("Результат:")
88
+ result = re.split(r'[.\n]+', user_input)
89
+ result = [part for part in result if part.strip() != ""]
90
+ for text in result:
91
+ highlight_obscene_words(text)
92
  else:
93
  st.warning("Пожалуйста, введите текст для проверки")