sandbox338 commited on
Commit
bd3e9f0
·
verified ·
1 Parent(s): 5ddfe23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,8 +7,8 @@ classifier = pipeline("text-classification", model="sandbox338/hatespeech")
7
  # Define the function for the interface
8
  def classify_text(text):
9
  results = classifier(text)
10
- # Sort by score and show top result
11
- return f"{results[0]['label']} ({results[0]['score']:.2f})"
12
 
13
  # Create the interface
14
  interface = gr.Interface(
@@ -21,4 +21,4 @@ interface = gr.Interface(
21
 
22
  # Launch the interface (only used if running locally)
23
  if __name__ == "__main__":
24
- interface.launch()
 
7
  # Define the function for the interface
8
  def classify_text(text):
9
  results = classifier(text)
10
+ # Return only the label without the score
11
+ return results[0]['label']
12
 
13
  # Create the interface
14
  interface = gr.Interface(
 
21
 
22
  # Launch the interface (only used if running locally)
23
  if __name__ == "__main__":
24
+ interface.launch()