Kingston Yip commited on
Commit
39007cc
β€’
1 Parent(s): 2427ad9
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -79,16 +79,15 @@ with st.form("my_form"):
79
  default = "I'm nice at ping pong"
80
  tweet = st.text_area(label="Enter Text:",value=default)
81
  submitted = st.form_submit_button("Analyze textbox")
82
- random = st.form_submit_button("Analyze a random 😈😈😈 tweet")
83
 
84
  if random:
85
  tweet = comments.comments[randint(0, 354)]
86
  st.write(tweet)
 
87
 
88
-
89
- df = perform_cyberbullying_analysis(tweet)
90
-
91
- # Display the cached table
92
- st.table(df)
93
  else:
94
  perform_default_analysis(model_name)
 
79
  default = "I'm nice at ping pong"
80
  tweet = st.text_area(label="Enter Text:",value=default)
81
  submitted = st.form_submit_button("Analyze textbox")
82
+ random = st.form_submit_button("Analyze a random 😈😈😈 tweet (warning!!)")
83
 
84
  if random:
85
  tweet = comments.comments[randint(0, 354)]
86
  st.write(tweet)
87
+ submitted = True
88
 
89
+ if submitted:
90
+ df = perform_cyberbullying_analysis(tweet)
91
+ st.table(df)
 
 
92
  else:
93
  perform_default_analysis(model_name)