Spaces:
Runtime error
Runtime error
File size: 1,056 Bytes
01cbf36 4a604a4 a4e0ec7 4a604a4 c94e414 a6a4428 a4e0ec7 7a5f23b a4e0ec7 7474a76 736e038 a6a4428 01cbf36 9bbe331 01cbf36 4a604a4 |
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 27 28 29 30 31 32 |
from analze import *
import streamlit as st
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:
st.success("File uploaded successfully!")
Txtf = text_feature(uploaded_file)
Htmlf = html_tags_feature(uploaded_file)
Numf = num_feature(uploaded_file)
Extraf = extra_feature(uploaded_file)
feat = get_features(uploaded_file)
feat.at[0,"text"] = Txtf.at[0,"text"]
columns = feat.columns.tolist()
columns = [columns[-1]] + columns[:-1]
feat = feat[columns]
st.write(uploaded_file.read())
st.write(feat)
# st.write(txt)
st.write("Text Prediction: "+predict_content(Txtf))
st.write("HTML Tags Prediction: "+predict_html(Htmlf))
st.write("Numeric Features Prediction: "+predict_num(Numf))
st.write("Extra Features Prediction: "+predict_extra(Extraf))
if __name__ == '__main__':
main()
|