Cricles commited on
Commit
671ebd0
·
verified ·
1 Parent(s): d623620

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -78,16 +78,16 @@ model_type = st.radio(
78
  def highlight_obscene_words(text, model_type):
79
  if model_type=="FRIDA":
80
  result=model_wrapper(text, model_type)
81
- st.markdown(f"{result}")
82
  for item in result:
83
- if item[1][0].label=="non-toxic":
84
  st.markdown(
85
- "<span style='background:#47916B;'>{}:приемлемо</span>".format(item[1][0].text),
86
  unsafe_allow_html=True
87
  )
88
  else:
89
  st.markdown(
90
- "<span style='background:#ffcccc;'>{}:токсично</span>".format(item[1][0].text),
91
  unsafe_allow_html=True
92
  )
93
  else:
 
78
  def highlight_obscene_words(text, model_type):
79
  if model_type=="FRIDA":
80
  result=model_wrapper(text, model_type)
81
+ result=result.predictions
82
  for item in result:
83
+ if item.label=="non-toxic":
84
  st.markdown(
85
+ "<span style='background:#47916B;'>{}:приемлемо</span>".format(item.text),
86
  unsafe_allow_html=True
87
  )
88
  else:
89
  st.markdown(
90
+ "<span style='background:#ffcccc;'>{}:токсично</span>".format(item.text),
91
  unsafe_allow_html=True
92
  )
93
  else: