Recently, I built a small project where I created a spam classifier that can detect whether a message is spam or not.
This is part of my learning journey in Artificial Intelligence and Machine Learning, and I wanted to build something practical instead of just reading theory.
π‘ Why I Built This
While learning machine learning, I understood that just watching tutorials is not enough. The best way to learn is by building projects.
Spam detection is something we see in real life (emails, messages, etc.), so I thought it would be a good project to start with.
π What This Project Does
The application takes a text message as input and tells whether it is:
Spam
Not Spam
Example:
Input:
You have won a free iPhone!
Output:
Spam (Confidence: 99%)
π§ How It Works (Simple Explanation)
I used a basic machine learning pipeline:
Clean the text (remove unwanted words and symbols)
Convert text into numbers using TF-IDF
Train a Naive Bayes model
Use the trained model to predict new inputs
π Tech Stack
Python
scikit-learn
pandas
nltk
Flask
HTML, CSS, JavaScript
βοΈ Project Structure
The project is divided into different parts:
preprocessing.py β cleans the text
train.py β trains the model
predict.py β predicts from command line
app.py β Flask backend
index.html β frontend
π How the Web App Works
User enters a message
Frontend sends request to Flask
Backend processes the text
Model predicts the result
Result is shown instantly
π§ͺ What I Learned
From this project, I understood:
how NLP works at a basic level
how machine learning models are trained
how to connect ML with a web application
how to create a simple API using Flask
This was my first time building a full project from start to end, and it helped me understand things much better.
π GitHub
You can check out the project here:
https://github.com/alenkurian-ml/spam-classifier
π Final Thoughts
This is a small project, but for me it was an important step in learning AI.
Iβm still learning and building projects step by step. I plan to explore more advanced topics and improve my skills.
If you are also learning machine learning, I would suggest starting with small projects like this.
Thanks for reading π
Top comments (0)