Spaces:
Sleeping
Sleeping
import streamlit as st | |
import pickle | |
# Load the pre-trained phishing detection model from the .pkl file | |
with open('phishing (2).pkl', 'rb') as model_file: | |
phishing_model = pickle.load(model_file) | |
def is_phishing(url): | |
# Replace this with your actual prediction logic | |
# Example: You might need to preprocess the URL before making predictions | |
# prediction = phishing_model.predict(preprocess(url)) | |
prediction = phishing_model.predict([url]) # Assuming the model expects a list of URLs | |
return prediction[0] | |
def main(): | |
st.title('Phishing Detection App') | |
url = st.text_input('Enter URL:') | |
if st.button('Check for Phishing'): | |
result = is_phishing(url) | |
st.write(f'The URL is {"phishing" if result else "not phishing"}') | |
if __name__ == '__main__': | |
main() | |