pgurazada1 commited on
Commit
1674c44
·
verified ·
1 Parent(s): b740eac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -17,8 +17,12 @@ classifier = pipeline(
17
  )
18
 
19
  def predict(user_input: str):
 
 
 
 
20
 
21
- return classifier(user_input)
22
 
23
 
24
  textbox = gr.Textbox(placeholder="Enter user input presented for injection attack classification", lines=12)
 
17
  )
18
 
19
  def predict(user_input: str):
20
+
21
+ prediction = classifier(user_input)[0]
22
+ label = prediction['label']
23
+ probability = prediction['score']
24
 
25
+ return f"The input is like to be a {label} with probability: {probability}"
26
 
27
 
28
  textbox = gr.Textbox(placeholder="Enter user input presented for injection attack classification", lines=12)