Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def load_classifier():
|
|
| 10 |
|
| 11 |
classifier = load_classifier()
|
| 12 |
|
| 13 |
-
st.title("Email Classifier")
|
| 14 |
|
| 15 |
# Input email
|
| 16 |
email_input = st.text_area("Paste your email here:")
|
|
@@ -23,9 +23,10 @@ if st.button("Analyze"):
|
|
| 23 |
pii_result = mask_pii(email_input)
|
| 24 |
|
| 25 |
# Step 2: Predict category
|
| 26 |
-
masked_text = pii_result["
|
| 27 |
prediction = classifier.predict(masked_text)
|
| 28 |
pii_result["category_of_the_email"] = prediction
|
|
|
|
| 29 |
# Step 3: Format full output
|
| 30 |
# output = {
|
| 31 |
# "input_email_body": email_input,
|
|
|
|
| 10 |
|
| 11 |
classifier = load_classifier()
|
| 12 |
|
| 13 |
+
st.title("Email Classifier with PII Masking")
|
| 14 |
|
| 15 |
# Input email
|
| 16 |
email_input = st.text_area("Paste your email here:")
|
|
|
|
| 23 |
pii_result = mask_pii(email_input)
|
| 24 |
|
| 25 |
# Step 2: Predict category
|
| 26 |
+
masked_text = pii_result["English_masked"]
|
| 27 |
prediction = classifier.predict(masked_text)
|
| 28 |
pii_result["category_of_the_email"] = prediction
|
| 29 |
+
del pii_result["English_masked"]
|
| 30 |
# Step 3: Format full output
|
| 31 |
# output = {
|
| 32 |
# "input_email_body": email_input,
|