Cricles commited on
Commit
2b92000
·
verified ·
1 Parent(s): bda8576

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -76,15 +76,15 @@ model_type = st.radio(
76
  )
77
 
78
  def highlight_obscene_words(text, model_type):
79
- label=model_wrapper(text.lower(),model_type)
80
  if label=='__label__positive':
81
  st.markdown(
82
- "<span style='background:#47916B;'>{}|приемлемо</span>".format(text),
83
  unsafe_allow_html=True
84
  )
85
  else:
86
  st.markdown(
87
- "<span style='background:#ffcccc;'>{}|токсично</span>".format(text),
88
  unsafe_allow_html=True
89
  )
90
 
 
76
  )
77
 
78
  def highlight_obscene_words(text, model_type):
79
+ label, prob=model_wrapper(text.lower(),model_type)
80
  if label=='__label__positive':
81
  st.markdown(
82
+ "<span style='background:#47916B;'>{}:приемлемо</span>".format(text),
83
  unsafe_allow_html=True
84
  )
85
  else:
86
  st.markdown(
87
+ "<span style='background:#ffcccc;'>{}:токсично-{:.2f}</span>".format(text,prob),
88
  unsafe_allow_html=True
89
  )
90