Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,12 @@ classifier = pipeline(
|
|
17 |
)
|
18 |
|
19 |
def predict(user_input: str):
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
return
|
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)
|