Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,16 +5,16 @@ from transformers import pipeline
|
|
5 |
classifier = pipeline("text-classification", model='kithangw/phishing_link_detection')
|
6 |
|
7 |
# Streamlit application title
|
8 |
-
st.title("Please enter a suspicious
|
9 |
|
10 |
-
# Text input for user to enter the
|
11 |
-
email = st.text_area("Enter the
|
12 |
|
13 |
# Perform text classification when the user clicks the "Classify" button
|
14 |
if st.button("Classify"):
|
15 |
-
if
|
16 |
-
# Perform text classification on the input
|
17 |
-
results = classifier(
|
18 |
|
19 |
# The results variable contains a list with one item, which is a dictionary.
|
20 |
# The dictionary has 'label' and 'score' as keys.
|
@@ -24,8 +24,8 @@ if st.button("Classify"):
|
|
24 |
|
25 |
# Check the label and print out the corresponding message
|
26 |
if label == "LABEL_1": # Assuming LABEL_1 indicates phishing
|
27 |
-
st.write(f"The
|
28 |
else: # Assuming LABEL_0 indicates not phishing
|
29 |
-
st.write(f"The
|
30 |
else:
|
31 |
-
st.error("Please enter an
|
|
|
5 |
classifier = pipeline("text-classification", model='kithangw/phishing_link_detection')
|
6 |
|
7 |
# Streamlit application title
|
8 |
+
st.title("Please enter a suspicious link")
|
9 |
|
10 |
+
# Text input for user to enter the link to classify
|
11 |
+
email = st.text_area("Enter the link to classify", "")
|
12 |
|
13 |
# Perform text classification when the user clicks the "Classify" button
|
14 |
if st.button("Classify"):
|
15 |
+
if link: # Check if link is not empty
|
16 |
+
# Perform text classification on the input link
|
17 |
+
results = classifier(link)
|
18 |
|
19 |
# The results variable contains a list with one item, which is a dictionary.
|
20 |
# The dictionary has 'label' and 'score' as keys.
|
|
|
24 |
|
25 |
# Check the label and print out the corresponding message
|
26 |
if label == "LABEL_1": # Assuming LABEL_1 indicates phishing
|
27 |
+
st.write(f"The link you entered is {score}% likely to be a phishing email.")
|
28 |
else: # Assuming LABEL_0 indicates not phishing
|
29 |
+
st.write(f"The link you entered is {score}% likely to be not a phishing email.")
|
30 |
else:
|
31 |
+
st.error("Please enter an link to classify.")
|