kaisarhossain's picture
Update README.md
806623d verified

A newer version of the Streamlit SDK is available: 1.55.0

Upgrade
metadata
title: Smart Email Classification App
emoji: πŸ“§
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.25.0
app_file: app.py
pinned: false

πŸ“§ Smart Email Classifier: Classifying emails using Natural Language Processing (NLP)

Python Streamlit License

Smart Email Classifier application is your companion to classify emails of different types based on email subject or body using advanced Natural Language Processing (NLP) techniques and fine-tuned model.

🧠 Categories

  • πŸ“’ Promotions
  • 🚫 Spam
  • πŸ’¬ Social Media Updates
  • πŸ—£οΈ Forum Updates
  • πŸ”’ Code Verification
  • πŸ’Ό Work Updates

🧩 Project Structure

Email-Classifier-AI/
β”‚
β”œβ”€β”€ app.py                                # Main Streamlit application
β”œβ”€β”€ .env                                  # Secret API Keys (ignored by Git)
β”œβ”€β”€ requirements.txt                      # Required Python dependencies
β”œβ”€β”€ Dockerfile                            # Docker setup for Hugging Face deployment
β”œβ”€β”€ README.md                             # Project documentation
└── .gitignore                            # Ignored files

βš™οΈ Installation and Setup

1️⃣ Create a Virtual Environment (Recommended)

python -m venv venv
source venv/bin/activate       # (Linux/Mac)
venv\Scripts\activate          # (Windows)

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Add Your API Keys (if any)

Create a .env file in your project root:

HF_TOKEN=<Your HF Token>
MODEL_REPO=kaisarhossain/email-classifier-distilbert-finetuned-kaisar

▢️ Run the App Locally

streamlit run app.py

The app will launch automatically in your browser at:

http://localhost:8501

🐳 Deploying on Hugging Face (Docker Method)

1️⃣ Create a Dockerfile

Example:

# Base image
FROM python:3.10

# Set working directory
WORKDIR /app

# Copy project files
COPY . .

# Install dependencies
RUN pip install -r requirements.txt

# Expose Streamlit port
EXPOSE 8501

# Run Streamlit app
CMD ["streamlit", "run", "email_classifier_streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]

2️⃣ Push to Hugging Face Space

  • Create a new Hugging Face Space β†’ Select Docker as the SDK.
  • Connect your GitHub repository or upload the project manually.
  • Hugging Face automatically builds and runs your app.

🧾 Example Usage

Input:

"Your verification code is 348211. Please do not share it with anyone."

Predicted Category:

πŸ”’ Code Verification


πŸ’‘ Future Enhancements

  • Add email body + subject dual-input model
  • Integrate real-time Gmail API ingestion
  • Add multilingual email classification
  • Enable fine-tuning with user-specific data

🀝 Contributing

Contributions are welcome!
Fork this repo, make your improvements, and submit a pull request.


πŸͺͺ License

This project is licensed under the Apache 2.0 License β€” feel free to use and modify it.


πŸ‘¨β€πŸ’» Author

Mohammed Golam Kaisar Hossain Bhuyan πŸš€ AI | ML | NLP | Deep Learning
πŸ”— LinkedIn | GitHub


=======

title: Smart Email Classification App emoji: 🐒 colorFrom: indigo colorTo: green sdk: gradio sdk_version: 5.49.1 app_file: app.py pinned: false license: apache-2.0 short_description: Smart-Email-Classification-App

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

f3f984eb444ce50d2f26830c247442faab422fb5