Mohammed Golam Kaisar Hossain Bhuyan commited on
Commit
f6c9fdc
Β·
1 Parent(s): 8220955

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +141 -0
README.md CHANGED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # πŸ“§ Smart Email Classifier: Classifying emails using Natural Language Processing (NLP)
2
+
3
+ [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org)
4
+ [![Streamlit](https://img.shields.io/badge/Streamlit-App%20Framework-red.svg)](https://streamlit.io/)
5
+ [![License](https://img.shields.io/badge/License-Apache-yellow.svg)](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
+ ---