devanshsrivastav commited on
Commit
6e4564b
1 Parent(s): 29d3362

added hate speech visualization

Browse files
EDxHuggingface.py CHANGED
@@ -136,8 +136,27 @@ if st.button("Submit"):
136
  fig.update_layout(height=400, margin=dict(t=50, b=5, l=0, r=0))
137
 
138
  # Display gauge charts
 
 
 
 
 
139
  st.plotly_chart(fig, use_container_width=True)
140
 
141
  # Display Hate Speech Classification
142
  hate_detection = label_hs[predicted_probabilities_HS[0]['label']]
143
- st.text(f"Hate Speech Classification: {hate_detection}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  fig.update_layout(height=400, margin=dict(t=50, b=5, l=0, r=0))
137
 
138
  # Display gauge charts
139
+ st.text("")
140
+ st.text("")
141
+ st.text("")
142
+ st.header("Emotion Detection")
143
+ st.text("")
144
  st.plotly_chart(fig, use_container_width=True)
145
 
146
  # Display Hate Speech Classification
147
  hate_detection = label_hs[predicted_probabilities_HS[0]['label']]
148
+ st.text("")
149
+ st.text("")
150
+ st.text("")
151
+ st.header("Hate Speech Analysis")
152
+ st.text("")
153
+ col1, col2 = st.columns(2)
154
+
155
+ col1.image(f"assets/{hate_detection}.jpg", width=200)
156
+ col2.text("")
157
+ col2.text("")
158
+ col2.text("")
159
+ col2.text("")
160
+ col2.subheader(f"The given text is {hate_detection}")
161
+
162
+
assets/Acceptable.jpg ADDED
assets/Inappropriate.jpg ADDED
assets/Offensive.jpg ADDED
assets/Violent.jpg ADDED