Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def preprocess_html(html):
|
|
| 44 |
return ' '.join(tokens)
|
| 45 |
|
| 46 |
# Load trained model
|
| 47 |
-
model = keras.models.load_model('
|
| 48 |
|
| 49 |
# Define maximum length and number of words
|
| 50 |
max_url_length = 180
|
|
@@ -81,12 +81,12 @@ def predict_phishing(url, html):
|
|
| 81 |
interface = gr.Interface(
|
| 82 |
fn=predict_phishing,
|
| 83 |
inputs=[
|
| 84 |
-
gr.
|
| 85 |
-
gr.
|
| 86 |
],
|
| 87 |
outputs=[
|
| 88 |
-
gr.
|
| 89 |
-
gr.
|
| 90 |
],
|
| 91 |
title="Phishing Detection Model",
|
| 92 |
description="Enter a URL and its HTML content to predict if it's spam or legitimate."
|
|
|
|
| 44 |
return ' '.join(tokens)
|
| 45 |
|
| 46 |
# Load trained model
|
| 47 |
+
model = keras.models.load_model('/content/drive/MyDrive/fix_phishing_detection_model.keras')
|
| 48 |
|
| 49 |
# Define maximum length and number of words
|
| 50 |
max_url_length = 180
|
|
|
|
| 81 |
interface = gr.Interface(
|
| 82 |
fn=predict_phishing,
|
| 83 |
inputs=[
|
| 84 |
+
gr.components.Textbox(label="URL"),
|
| 85 |
+
gr.components.Textbox(label="HTML Snippet")
|
| 86 |
],
|
| 87 |
outputs=[
|
| 88 |
+
gr.components.Textbox(label="Predicted Category"),
|
| 89 |
+
gr.components.Textbox(label="Predicted Probability")
|
| 90 |
],
|
| 91 |
title="Phishing Detection Model",
|
| 92 |
description="Enter a URL and its HTML content to predict if it's spam or legitimate."
|