Spaces:
Running
Running
Update app.py
Browse files
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;'>{}
|
83 |
unsafe_allow_html=True
|
84 |
)
|
85 |
else:
|
86 |
st.markdown(
|
87 |
-
"<span style='background:#ffcccc;'>{}
|
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 |
|