Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -722,12 +722,22 @@ gbc = GradientBoostingClassifier(max_depth=4,learning_rate=0.7)
|
|
| 722 |
gbc.fit(X_train,y_train)
|
| 723 |
|
| 724 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 725 |
url = st.text_input("Enter the Url:", key="url_input")
|
| 726 |
#can provide any URL. this URL was taken from PhishTank
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
if
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 722 |
gbc.fit(X_train,y_train)
|
| 723 |
|
| 724 |
import streamlit as st
|
| 725 |
+
st.title("Phishing Website Detection")
|
| 726 |
+
|
| 727 |
+
# User input for URL
|
| 728 |
url = st.text_input("Enter the Url:", key="url_input")
|
| 729 |
#can provide any URL. this URL was taken from PhishTank
|
| 730 |
+
|
| 731 |
+
# Predict and display the result
|
| 732 |
+
if st.button("Check"):
|
| 733 |
+
if url:
|
| 734 |
+
obj = FeatureExtraction(url)
|
| 735 |
+
x = np.array(obj.getFeaturesList()).reshape(1, 30)
|
| 736 |
+
y_pred = gbc.predict(x)[0]
|
| 737 |
+
if y_pred == 1:
|
| 738 |
+
st.write("We guess it is a safe website")
|
| 739 |
+
else:
|
| 740 |
+
st.write("Caution! Suspicious website detected")
|
| 741 |
+
st.write(y_pred)
|
| 742 |
+
else:
|
| 743 |
+
st.write("Please enter a URL.")
|