Rob Caamano commited on
Commit
cb4608c
·
unverified ·
1 Parent(s): 1167df7
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -7,7 +7,7 @@ from transformers import (
7
 
8
  st.title("Detecting Toxic Tweets")
9
 
10
- demo = """I'm so proud of myself for accomplishing my goals today. #motivation #success"""
11
 
12
  text = st.text_area("Input text", demo, height=250)
13
 
@@ -42,15 +42,15 @@ if st.button("Submit", type="primary"):
42
  column_name = "Highest Toxicity Class"
43
  else:
44
  column_name = "Prediction"
45
-
46
  if probability < 0.1:
47
  st.write("This tweet is not toxic.")
48
- else:
49
- df = pd.DataFrame(
50
- {
51
- "Tweet (portion)": [tweet_portion],
52
- column_name: [label],
53
- "Probability": [probability],
54
- }
55
- )
56
- st.table(df)
 
7
 
8
  st.title("Detecting Toxic Tweets")
9
 
10
+ demo = """Your words are like poison. They seep into my mind and make me feel worthless."""
11
 
12
  text = st.text_area("Input text", demo, height=250)
13
 
 
42
  column_name = "Highest Toxicity Class"
43
  else:
44
  column_name = "Prediction"
45
+
46
  if probability < 0.1:
47
  st.write("This tweet is not toxic.")
48
+
49
+ df = pd.DataFrame(
50
+ {
51
+ "Tweet (portion)": [tweet_portion],
52
+ column_name: [label],
53
+ "Probability": [probability],
54
+ }
55
+ )
56
+ st.table(df)