iimran commited on
Commit
0f3fb53
·
verified ·
1 Parent(s): 7e57720

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -69,10 +69,7 @@ if __name__ == "__main__":
69
 
70
  # Example texts for testing
71
  example_texts = [
72
- "This content contains explicit language and violent threats",
73
- "The weather today is pleasant and suitable for all ages",
74
- "You're a worthless piece of garbage who should die",
75
- "Please remember to submit your reports by Friday"
76
  ]
77
 
78
  for text in example_texts:
@@ -86,8 +83,8 @@ if __name__ == "__main__":
86
  def gradio_predict(text):
87
  result = pipeline.predict(text)
88
  return (
89
- f"Prediction: {result['label']} ({result['confidence']:.2%})\n"
90
- f"Probabilities: Inappropriate={result['probabilities'][0]:.2%}, Not Inappropriate={result['probabilities'][1]:.2%}"
91
  )
92
 
93
  # Create a Gradio interface
@@ -96,7 +93,7 @@ if __name__ == "__main__":
96
  inputs=gr.Textbox(lines=7, placeholder="Enter text here..."),
97
  outputs="text",
98
  title="RudeRater - Content Appropriateness Classifier",
99
- description="RudeRater is designed to identify inappropriate content in text. It analyzes input for offensive language, explicit content, or harmful material. Enter text to check its appropriateness.",
100
  examples=[
101
  "Congrats, you fuckbrain arsehole, you’ve outdone yourself in stupidity. A real cock-up of a human—should we clap for your bollocks-faced greatness or just pity you?",
102
  "You’re a mad bastard, but I’d still grab a beer with you! Fuck around all you like, you cockheaded legend—your arsehole antics are bloody brilliant.",
 
69
 
70
  # Example texts for testing
71
  example_texts = [
72
+ "You're a worthless piece of garbage who should die"
 
 
 
73
  ]
74
 
75
  for text in example_texts:
 
83
  def gradio_predict(text):
84
  result = pipeline.predict(text)
85
  return (
86
+ f"Prediction: {result['label']} \n"
87
+ #f"Probabilities: Inappropriate={result['probabilities'][0]:.2%}, Not Inappropriate={result['probabilities'][1]:.2%}"
88
  )
89
 
90
  # Create a Gradio interface
 
93
  inputs=gr.Textbox(lines=7, placeholder="Enter text here..."),
94
  outputs="text",
95
  title="RudeRater - Content Appropriateness Classifier",
96
+ description="RudeRater is designed to identify inappropriate content in text. It analyzes input for offensive language and explicit content. It's trained on a tiny database so it might not be able to detect something fancy, but should easily detect day to day used offensive language.",
97
  examples=[
98
  "Congrats, you fuckbrain arsehole, you’ve outdone yourself in stupidity. A real cock-up of a human—should we clap for your bollocks-faced greatness or just pity you?",
99
  "You’re a mad bastard, but I’d still grab a beer with you! Fuck around all you like, you cockheaded legend—your arsehole antics are bloody brilliant.",