allenchienxxx commited on
Commit
a4e0ec7
1 Parent(s): d6da36b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -3,7 +3,7 @@ import streamlit as st
3
 
4
  def main():
5
  st.title("Phishing Email Filtering Service")
6
- const uploaded_file = st.file_uploader("Upload a file", type=['eml', 'txt'])
7
  if uploaded_file is not None:
8
  st.success("File uploaded successfully!")
9
 
@@ -12,13 +12,13 @@ def main():
12
  Numf = num_feature(uploaded_file)
13
  Extraf = extra_feature(uploaded_file)
14
 
15
- # feat = get_features(uploaded_file)
16
- # feat.at[0,"text"] = txt.at[0,"text"]
17
- # columns = feat.columns.tolist()
18
- # columns = [columns[-1]] + columns[:-1]
19
- # feat = feat[columns]
20
- # st.write(uploaded_file.read())
21
- # st.write(feat)
22
  # st.write(txt)
23
  st.write("Text Prediction: "+predict_content(Txtf))
24
  st.write("HTML Tags Prediction: "+predict_html(Htmlf))
 
3
 
4
  def main():
5
  st.title("Phishing Email Filtering Service")
6
+ uploaded_file = st.file_uploader("Upload a file", type=['eml', 'txt'])
7
  if uploaded_file is not None:
8
  st.success("File uploaded successfully!")
9
 
 
12
  Numf = num_feature(uploaded_file)
13
  Extraf = extra_feature(uploaded_file)
14
 
15
+ feat = get_features(uploaded_file)
16
+ feat.at[0,"text"] = txt.at[0,"text"]
17
+ columns = feat.columns.tolist()
18
+ columns = [columns[-1]] + columns[:-1]
19
+ feat = feat[columns]
20
+ st.write(uploaded_file.read())
21
+ st.write(feat)
22
  # st.write(txt)
23
  st.write("Text Prediction: "+predict_content(Txtf))
24
  st.write("HTML Tags Prediction: "+predict_html(Htmlf))