Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from models import load_model
|
| 3 |
from utils import mask_pii
|
|
@@ -6,7 +7,7 @@ st.set_page_config(page_title="π§ Email Classification System", page_icon="
|
|
| 6 |
|
| 7 |
st.title("π§ Email Classification and PII Masking System")
|
| 8 |
|
| 9 |
-
# Load
|
| 10 |
model = load_model("model/classifier.pkl")
|
| 11 |
|
| 12 |
# Prediction function
|
|
@@ -20,7 +21,7 @@ def classify_email_direct(email_body):
|
|
| 20 |
"category_of_the_email": category
|
| 21 |
}
|
| 22 |
|
| 23 |
-
# UI
|
| 24 |
email_input = st.text_area("βοΈ Enter your email text:")
|
| 25 |
|
| 26 |
if st.button("π Classify Email"):
|
|
@@ -36,4 +37,4 @@ if st.button("π Classify Email"):
|
|
| 36 |
st.subheader("π Predicted Category")
|
| 37 |
st.success(result['category_of_the_email'])
|
| 38 |
else:
|
| 39 |
-
st.warning("β οΈ Please enter some
|
|
|
|
| 1 |
+
# streamlit_app.py
|
| 2 |
import streamlit as st
|
| 3 |
from models import load_model
|
| 4 |
from utils import mask_pii
|
|
|
|
| 7 |
|
| 8 |
st.title("π§ Email Classification and PII Masking System")
|
| 9 |
|
| 10 |
+
# Load model
|
| 11 |
model = load_model("model/classifier.pkl")
|
| 12 |
|
| 13 |
# Prediction function
|
|
|
|
| 21 |
"category_of_the_email": category
|
| 22 |
}
|
| 23 |
|
| 24 |
+
# Streamlit UI
|
| 25 |
email_input = st.text_area("βοΈ Enter your email text:")
|
| 26 |
|
| 27 |
if st.button("π Classify Email"):
|
|
|
|
| 37 |
st.subheader("π Predicted Category")
|
| 38 |
st.success(result['category_of_the_email'])
|
| 39 |
else:
|
| 40 |
+
st.warning("β οΈ Please enter some text first.")
|