Spaces:
Runtime error
Runtime error
Palplatine
commited on
Commit
•
faca89f
1
Parent(s):
e0a7610
Removing columns for gauge
Browse files
app.py
CHANGED
@@ -195,23 +195,19 @@ with st.expander('Input a sentence and check the probability of it being hateful
|
|
195 |
percentage = y_pred[0][0] * 100
|
196 |
|
197 |
# Scoreboard du prêt
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
domain = {'x': [0, 1], 'y': [0, 1]},
|
212 |
-
title = {'text': 'Probability of your sentence being hateful'}))
|
213 |
-
|
214 |
-
st.plotly_chart(fig1)
|
215 |
|
216 |
if y_pred[0][0] < 0.5:
|
217 |
st.write(f"Congrats, it's not hateful!!!")
|
|
|
195 |
percentage = y_pred[0][0] * 100
|
196 |
|
197 |
# Scoreboard du prêt
|
198 |
+
fig1 = go.Figure(go.Indicator(
|
199 |
+
mode = "gauge+number+delta",
|
200 |
+
value = y_pred[0][0],
|
201 |
+
delta = {'reference': 0.50},
|
202 |
+
gauge = {'axis': {'range': [None, 1]},
|
203 |
+
'steps' : [
|
204 |
+
{'range': [0, 0.5], 'color': "lightgray"},
|
205 |
+
{'range': [0.5, 0.75], 'color': "gray"}],
|
206 |
+
'threshold' : {'line': {'color': "red", 'width': 4}, 'thickness': 0.9, 'value': 0.5}},
|
207 |
+
domain = {'x': [0, 1], 'y': [0, 1]},
|
208 |
+
title = {'text': 'Probability of your sentence being hateful'}))
|
209 |
+
|
210 |
+
st.plotly_chart(fig1)
|
|
|
|
|
|
|
|
|
211 |
|
212 |
if y_pred[0][0] < 0.5:
|
213 |
st.write(f"Congrats, it's not hateful!!!")
|