--- 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](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org) [![Streamlit](https://img.shields.io/badge/Streamlit-App%20Framework-red.svg)](https://streamlit.io/) [![License](https://img.shields.io/badge/License-Apache-yellow.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt) > **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) ```bash python -m venv venv source venv/bin/activate # (Linux/Mac) venv\Scripts\activate # (Windows) ``` ### 2๏ธโƒฃ Install Dependencies ```bash pip install -r requirements.txt ``` ### 3๏ธโƒฃ Add Your API Keys (if any) Create a `.env` file in your project root: ```bash HF_TOKEN= MODEL_REPO=kaisarhossain/email-classifier-distilbert-finetuned-kaisar ``` --- ## โ–ถ๏ธ Run the App Locally ```bash 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: ```dockerfile # 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](https://www.linkedin.com/in/kaisarhossain) | [GitHub](https://github.com/kaisarhossain) --- ======= --- 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