app update
Browse files
app.py
CHANGED
|
@@ -125,7 +125,7 @@ def get_severity_class(probability):
|
|
| 125 |
# Header Section
|
| 126 |
st.title("π« Offensive Speech Detection")
|
| 127 |
st.markdown("""
|
| 128 |
-
This application helps identify potentially offensive
|
| 129 |
|
| 130 |
It uses a trained neural network to analyze text and determine if it contains offensive speech.
|
| 131 |
|
|
@@ -134,26 +134,10 @@ It uses a trained neural network to analyze text and determine if it contains of
|
|
| 134 |
1. Enter your text in the input box below
|
| 135 |
2. The model will analyze the content and provide a prediction based on the model
|
| 136 |
3. Results show both the classification and value predicted by the model
|
|
|
|
| 137 |
""")
|
| 138 |
|
| 139 |
|
| 140 |
-
# Example inputs
|
| 141 |
-
with st.expander("π Example Inputs"):
|
| 142 |
-
st.markdown("""
|
| 143 |
-
Try these example texts to test the model:
|
| 144 |
-
1. "Have a great day!"
|
| 145 |
-
2. "You are the worst person in the world."
|
| 146 |
-
3. "You're amazing!"
|
| 147 |
-
|
| 148 |
-
Click on any example to copy it to the input box.
|
| 149 |
-
""")
|
| 150 |
-
if st.button("Use Example 1"):
|
| 151 |
-
st.session_state.user_input = "Have a great day!"
|
| 152 |
-
if st.button("Use Example 2"):
|
| 153 |
-
st.session_state.user_input = "You are the worst person in the world."
|
| 154 |
-
if st.button("Use Example 3"):
|
| 155 |
-
st.session_state.user_input = "You're amazing!"
|
| 156 |
-
|
| 157 |
# FAQ Section
|
| 158 |
with st.expander("β Frequently Asked Questions"):
|
| 159 |
st.markdown("""
|
|
@@ -177,12 +161,12 @@ if st.button("Clear Input", key="clear_button"):
|
|
| 177 |
st.session_state.user_input = ""
|
| 178 |
|
| 179 |
# Text Input Section
|
| 180 |
-
max_chars =
|
| 181 |
user_input = st.text_area(
|
| 182 |
"Enter text to analyze:",
|
| 183 |
height=100,
|
| 184 |
key="user_input",
|
| 185 |
-
help="Enter the text you want to analyze for offensive content. Maximum
|
| 186 |
max_chars=max_chars
|
| 187 |
)
|
| 188 |
|
|
|
|
| 125 |
# Header Section
|
| 126 |
st.title("π« Offensive Speech Detection")
|
| 127 |
st.markdown("""
|
| 128 |
+
This application helps identify potentially offensive content in text provided by an user.
|
| 129 |
|
| 130 |
It uses a trained neural network to analyze text and determine if it contains offensive speech.
|
| 131 |
|
|
|
|
| 134 |
1. Enter your text in the input box below
|
| 135 |
2. The model will analyze the content and provide a prediction based on the model
|
| 136 |
3. Results show both the classification and value predicted by the model
|
| 137 |
+
4. The results is saved in the prediction history
|
| 138 |
""")
|
| 139 |
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
# FAQ Section
|
| 142 |
with st.expander("β Frequently Asked Questions"):
|
| 143 |
st.markdown("""
|
|
|
|
| 161 |
st.session_state.user_input = ""
|
| 162 |
|
| 163 |
# Text Input Section
|
| 164 |
+
max_chars = 500
|
| 165 |
user_input = st.text_area(
|
| 166 |
"Enter text to analyze:",
|
| 167 |
height=100,
|
| 168 |
key="user_input",
|
| 169 |
+
help="Enter the text you want to analyze for offensive content. Maximum 500 characters.",
|
| 170 |
max_chars=max_chars
|
| 171 |
)
|
| 172 |
|