GokulRajaR commited on
Commit
3947c07
·
verified ·
1 Parent(s): b6d0cf7

Upload 6 files

Browse files
Files changed (3) hide show
  1. app.py +54 -54
  2. hate_speech_model.h5 +2 -2
  3. tokenizer.json +0 -0
app.py CHANGED
@@ -1,54 +1,54 @@
1
- import streamlit as st
2
- from main import get_result
3
-
4
- def app():
5
- if 'user_input' not in st.session_state:
6
- st.session_state.user_input = ""
7
-
8
- st.title("Tweet Classification")
9
-
10
- user_input = st.text_input(
11
- "Enter a Tweet for Classification:",
12
- value=st.session_state.user_input,
13
- key="input_box"
14
- )
15
- st.session_state.user_input = user_input
16
-
17
- st.subheader("Examples:")
18
-
19
- example1 = "i want to teach you love like you've never felt it before. #quote #quotes #love #pakistan #allin216 #girls #boys #fashion #feelings"
20
- example2 = "Report: Google A.I. Is ‘Biased’ Against Gay People, Jews http://www.breitbart.com/tech/2017/10/26/report-go..."
21
- example3 = "I Hate #$%#$%Jewish%$#@%^^@#"
22
- example4 = "i get to see my daddy today!! #80days #gettingfed"
23
-
24
- col1, col2 = st.columns(2)
25
- with col1:
26
- if st.button(example1[:40] + "..."):
27
- st.session_state.user_input = example1
28
- with col2:
29
- if st.button(example2[:40] + "..."):
30
- st.session_state.user_input = example2
31
-
32
- st.write("\n")
33
-
34
- col1, col2 = st.columns(2)
35
- with col1:
36
- if st.button(example3[:40] + "..."):
37
- st.session_state.user_input = example3
38
- with col2:
39
- if st.button(example4[:40] + "..."):
40
- st.session_state.user_input = example4
41
-
42
- st.write("\n")
43
- submit_button = st.button("Submit")
44
-
45
- if submit_button:
46
- if user_input.strip():
47
- result = get_result(user_input)
48
- st.markdown(f'<p style="font-size: 20px; color: #FF6347; font-weight: bold;">Predicted Data: {result}</p>', unsafe_allow_html=True)
49
- else:
50
- st.warning("Please enter some text to classify.")
51
-
52
- if __name__ == "__main__":
53
- app()
54
-
 
1
+ import streamlit as st
2
+ from main import get_result
3
+
4
+ def app():
5
+ if 'user_input' not in st.session_state:
6
+ st.session_state.user_input = ""
7
+
8
+ st.title("Tweet Classification")
9
+
10
+ user_input = st.text_input(
11
+ "Enter a Tweet for Classification:",
12
+ value=st.session_state.user_input,
13
+ key="input_box"
14
+ )
15
+ st.session_state.user_input = user_input
16
+
17
+ st.subheader("Examples:")
18
+
19
+ example1 = "You done a great job my friend!"
20
+ example2 = "I love machine learning"
21
+ example3 = "I Hate #$%#$%Jewish%$#@%^^@#"
22
+ example4 = "what the fuck is happening here"
23
+
24
+ col1, col2 = st.columns(2)
25
+ with col1:
26
+ if st.button(example1[:40] + "..."):
27
+ st.session_state.user_input = example1
28
+ with col2:
29
+ if st.button(example2[:40] + "..."):
30
+ st.session_state.user_input = example2
31
+
32
+ st.write("\n")
33
+
34
+ col1, col2 = st.columns(2)
35
+ with col1:
36
+ if st.button(example3[:40] + "..."):
37
+ st.session_state.user_input = example3
38
+ with col2:
39
+ if st.button(example4[:40] + "..."):
40
+ st.session_state.user_input = example4
41
+
42
+ st.write("\n")
43
+ submit_button = st.button("Submit")
44
+
45
+ if submit_button:
46
+ if user_input.strip():
47
+ result = get_result(user_input)
48
+ st.write(f"**Predicted Data:** {result}")
49
+ st.markdown(f'<p style="font-size: 20px; color: #FF6347; font-weight: bold;">Predicted Data: {result}</p>', unsafe_allow_html=True)
50
+ else:
51
+ st.warning("Please enter some text to classify.")
52
+
53
+ if __name__ == "__main__":
54
+ app()
hate_speech_model.h5 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:09fd4df266f53a52f9aec19d19f67fb962f1a1cd09972c2fbc5fbb2cea058926
3
- size 29807080
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b342d428aef894a8962d58be66c3c368964a340431db56ec48f433e94f0a118e
3
+ size 29807064
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff