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)