CoolFace
Apppublic

Phyllis10/email-prioritization-dashboard

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

Email Prioritization Dashboard

An end-to-end email prioritization system that classifies incoming emails into actionable priority levels and provides an interactive dashboard for testing and evaluation.

This project demonstrates data preprocessing, rule-guided labeling, machine learning modeling, explainability, visualization of metrics, and online deployment using Hugging Face Spaces (Gradio).


Live Demo

Hugging Face Space: (add your Space URL here once deployed)


Problem Overview

The goal of this project is to simulate an email prioritization system that:

  • —Uses sender, subject, and body fields
  • —Assigns one of three priority labels:
  • —Prioritize – critical or security-related emails (MFA, verification, password reset)
  • —Default – general informational emails
  • —Slow – promotional or non-urgent emails
  • —Provides:
  • —Priority label
  • —Human-readable reasoning
  • —Model confidence score

Solution Design

1. Email Parsing

Raw email text is parsed into:

  • —from
  • —subject
  • —body

This ensures the model consumes realistic email signals.


2. Priority Label Generation

Rule-based labeling is used to simulate realistic email priorities:

  • —Security-related keywords → Prioritize
  • —Marketing-related keywords → Slow
  • —Otherwise → Default

These labels serve as training targets for the model.


3. Text Preprocessing

A lightweight and safe text cleaning pipeline:

  • —Removes email headers
  • —Preserves semantic tokens (URL, EMAIL, NUM)
  • —Normalizes text (lowercasing, spacing)

4. Model

  • —TF-IDF Vectorization (unigrams + bigrams)
  • —Logistic Regression

Chosen for simplicity, interpretability, and strong baseline performance.


5. Explainability

Each prediction includes:

  • —Label – predicted priority
  • —Reasoning – pattern-based explanation
  • —Confidence – model probability

This avoids black-box predictions.


Dashboard Features

Test Email Tab

  • —Input sender, subject, and body
  • —View label, reasoning, and confidence
  • —Preloaded examples for quick testing

Metrics Tab

  • —Accuracy
  • —Macro-F1 score
  • —Confusion matrix
  • —Full classification report

🛠 Tech Stack

  • —Python
  • —Gradio
  • —scikit-learn
  • —pandas, numpy
  • —matplotlib

Project Structure

.
├── app.py
├── requirements.txt
├── email_classification_dataset.csv
└── README.md

Run Locally

bash
pip install -r requirements.txt
python app.py

Deployment

This application is deployed using Hugging Face Spaces (Gradio SDK), making it publicly accessible without additional infrastructure.


Author

Phyllis Barikisu Snyper Data Science Engineer & AI Lead