d
File size: 819 Bytes
cf376e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()