jjmakes commited on
Commit
3b57e27
1 Parent(s): 54d3c44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -31,14 +31,20 @@ def get_score(model_base, text):
31
 
32
  # Ask user for input, return scores
33
  st.title("Toxic Comment Classifier")
34
- text_input = st.text_input("Enter text for toxicity classification",
35
- "I hope you die")
36
- submit_btn = st.button("Submit")
37
 
38
  # Drop down menu for model selection, default is roberta
39
  model_base = st.selectbox("Select a pretrained model",
40
  ["roberta-base", "bert-base-cased", "distilbert-base-cased"])
41
 
 
 
 
 
 
 
42
  if submit_btn and text_input:
43
  result = get_score(model_base, text_input)
44
 
@@ -70,9 +76,12 @@ scores_df = scores_df.round(2)
70
 
71
 
72
  st.subheader("Toxicity Scores for Random Comments")
73
- st.table(scores_df)
74
-
75
  # Create a button to reset the scores
76
  if st.button("Refresh Random Tweets"):
77
  reset_scores()
78
  st.success("New tweets have been loaded!")
 
 
 
 
31
 
32
  # Ask user for input, return scores
33
  st.title("Toxic Comment Classifier")
34
+ st.write("John Makely")
35
+ st.write("The following model's are fine tuned on the jigsaw-toxic-comment-classification dataset")
36
+ st.write("Please be patient and give the queries and tables time to load (max 2 minutes)")
37
 
38
  # Drop down menu for model selection, default is roberta
39
  model_base = st.selectbox("Select a pretrained model",
40
  ["roberta-base", "bert-base-cased", "distilbert-base-cased"])
41
 
42
+ text_input = st.text_input("Enter text for toxicity classification",
43
+ "I hope you die")
44
+ st.write("After hitting Submit, classification scores will be displayed for the provided text")
45
+ submit_btn = st.button("Submit")
46
+
47
+
48
  if submit_btn and text_input:
49
  result = get_score(model_base, text_input)
50
 
 
76
 
77
 
78
  st.subheader("Toxicity Scores for Random Comments")
79
+ st.write("The following table will grab random values from the jigsaw dataset and display their respective scores")
80
+ st.write("Please be patient as it may take some time for the scores to be passed through the model")
81
  # Create a button to reset the scores
82
  if st.button("Refresh Random Tweets"):
83
  reset_scores()
84
  st.success("New tweets have been loaded!")
85
+ st.table(scores_df)
86
+
87
+