Spaces:
Runtime error
Runtime error
allenchienxxx
commited on
Commit
•
c94e414
1
Parent(s):
94dbe99
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,19 @@
|
|
1 |
from analze import *
|
2 |
import streamlit as st
|
3 |
|
4 |
-
def is_valid_filetype(file):
|
5 |
-
valid_extensions = ['.eml', '.txt']
|
6 |
-
return any(file.name.endswith(ext) for ext in valid_extensions)
|
7 |
|
8 |
def main():
|
9 |
st.title("Phishing Email Filtering Service")
|
10 |
uploaded_file = st.file_uploader("Upload a file", type=['eml', 'txt'])
|
11 |
if uploaded_file is not None:
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
# st.write(predict_extra(extra_feature(uploaded_file)))
|
21 |
-
else:
|
22 |
-
st.error("Invalid file type. Please upload an EML or TXT file.")
|
23 |
|
24 |
|
25 |
if __name__ == '__main__':
|
|
|
1 |
from analze import *
|
2 |
import streamlit as st
|
3 |
|
|
|
|
|
|
|
4 |
|
5 |
def main():
|
6 |
st.title("Phishing Email Filtering Service")
|
7 |
uploaded_file = st.file_uploader("Upload a file", type=['eml', 'txt'])
|
8 |
if uploaded_file is not None:
|
9 |
+
st.success("File uploaded successfully!")
|
10 |
+
# Process the file here
|
11 |
+
st.write(uploaded_file.read())
|
12 |
+
# st.write(get_features(uploaded_file))
|
13 |
+
# st.write(predict_content(text_feature(uploaded_file)))
|
14 |
+
# st.write(predict_html(html_tags_feature(uploaded_file)))
|
15 |
+
# st.write(predict_num(num_feature(uploaded_file)))
|
16 |
+
# st.write(predict_extra(extra_feature(uploaded_file)))
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
if __name__ == '__main__':
|