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