File size: 4,013 Bytes
806623d fe13e9a 5a8b53f b05032d 5a8b53f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | ---
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)
[](https://python.org)
[](https://streamlit.io/)
[](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=<Your 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
|