A newer version of the Streamlit SDK is available:
1.55.0
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)
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