Update README.md
Browse files
README.md
CHANGED
|
@@ -1,145 +1,144 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
[](https://python.org)
|
| 4 |
+
[](https://streamlit.io/)
|
| 5 |
+
[](https://www.apache.org/licenses/LICENSE-2.0.txt)
|
| 6 |
+
|
| 7 |
+
> **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.**
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
## π§ Categories
|
| 11 |
+
- π’ **Promotions**
|
| 12 |
+
- π« **Spam**
|
| 13 |
+
- π¬ **Social Media Updates**
|
| 14 |
+
- π£οΈ **Forum Updates**
|
| 15 |
+
- π’ **Code Verification**
|
| 16 |
+
- πΌ **Work Updates**
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## π§© Project Structure
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
Email-Classifier-AI/
|
| 24 |
+
β
|
| 25 |
+
βββ app.py # Main Streamlit application
|
| 26 |
+
βββ .env # Secret API Keys (ignored by Git)
|
| 27 |
+
βββ requirements.txt # Required Python dependencies
|
| 28 |
+
βββ Dockerfile # Docker setup for Hugging Face deployment
|
| 29 |
+
βββ README.md # Project documentation
|
| 30 |
+
βββ .gitignore # Ignored files
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## βοΈ Installation and Setup
|
| 36 |
+
|
| 37 |
+
### 1οΈβ£ Create a Virtual Environment (Recommended)
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
python -m venv venv
|
| 41 |
+
source venv/bin/activate # (Linux/Mac)
|
| 42 |
+
venv\Scripts\activate # (Windows)
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
### 2οΈβ£ Install Dependencies
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
pip install -r requirements.txt
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
### 3οΈβ£ Add Your API Keys (if any)
|
| 52 |
+
|
| 53 |
+
Create a `.env` file in your project root:
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
HF_TOKEN=<Your HF Token>
|
| 57 |
+
MODEL_REPO=kaisarhossain/email-classifier-distilbert-finetuned-kaisar
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## βΆοΈ Run the App Locally
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
streamlit run app.py
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
The app will launch automatically in your browser at:
|
| 69 |
+
```
|
| 70 |
+
http://localhost:8501
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
## π³ Deploying on Hugging Face (Docker Method)
|
| 76 |
+
|
| 77 |
+
### 1οΈβ£ Create a `Dockerfile`
|
| 78 |
+
Example:
|
| 79 |
+
```dockerfile
|
| 80 |
+
# Base image
|
| 81 |
+
FROM python:3.10
|
| 82 |
+
|
| 83 |
+
# Set working directory
|
| 84 |
+
WORKDIR /app
|
| 85 |
+
|
| 86 |
+
# Copy project files
|
| 87 |
+
COPY . .
|
| 88 |
+
|
| 89 |
+
# Install dependencies
|
| 90 |
+
RUN pip install -r requirements.txt
|
| 91 |
+
|
| 92 |
+
# Expose Streamlit port
|
| 93 |
+
EXPOSE 8501
|
| 94 |
+
|
| 95 |
+
# Run Streamlit app
|
| 96 |
+
CMD ["streamlit", "run", "email_classifier_streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
### 2οΈβ£ Push to Hugging Face Space
|
| 100 |
+
|
| 101 |
+
- Create a new **Hugging Face Space** β Select **Docker** as the SDK.
|
| 102 |
+
- Connect your **GitHub repository** or upload the project manually.
|
| 103 |
+
- Hugging Face automatically builds and runs your app.
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
|
| 107 |
+
## π§Ύ Example Usage
|
| 108 |
+
|
| 109 |
+
**Input:**
|
| 110 |
+
> "Your verification code is 348211. Please do not share it with anyone."
|
| 111 |
+
|
| 112 |
+
**Predicted Category:**
|
| 113 |
+
> π’ **Code Verification**
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## π‘ Future Enhancements
|
| 118 |
+
- Add email body + subject dual-input model
|
| 119 |
+
- Integrate real-time Gmail API ingestion
|
| 120 |
+
- Add multilingual email classification
|
| 121 |
+
- Enable fine-tuning with user-specific data
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## π€ Contributing
|
| 126 |
+
Contributions are welcome!
|
| 127 |
+
Fork this repo, make your improvements, and submit a pull request.
|
| 128 |
+
|
| 129 |
+
---
|
| 130 |
+
|
| 131 |
+
## πͺͺ License
|
| 132 |
+
This project is licensed under the **Apache 2.0 License** β feel free to use and modify it.
|
| 133 |
+
|
| 134 |
+
---
|
| 135 |
+
|
| 136 |
+
## π¨βπ» Author
|
| 137 |
+
Mohammed Golam Kaisar Hossain Bhuyan
|
| 138 |
+
π AI | ML | NLP | Deep Learning
|
| 139 |
+
π [LinkedIn](https://www.linkedin.com/in/kaisarhossain) | [GitHub](https://github.com/kaisarhossain)
|
| 140 |
+
|
| 141 |
+
---
|
|
|
|
| 142 |
=======
|
| 143 |
---
|
| 144 |
title: Smart Email Classification App
|