from analze import * import streamlit as st def is_valid_filetype(file): valid_extensions = ['.eml', '.txt'] return any(file.name.endswith(ext) for ext in valid_extensions) def main(): st.title("Phishing Email Filtering Service") uploaded_file = st.file_uploader("Upload a file", type=['eml', 'txt']) if uploaded_file is not None: if is_valid_filetype(uploaded_file): st.success("File uploaded successfully!") # Process the file here st.write(get_features(uploaded_file.getbuffer())) st.write(predict_content(uploaded_file.getbuffer())) # st.write(predict_html(uploaded_file)) # st.write(predict_num(num_feature(filepath))) # st.write(predict_extra(extra_feature(filepath))) else: st.error("Invalid file type. Please upload an EML or TXT file.") if __name__ == '__main__': main()