Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Spambusters 👻🚫

This project implements a spam email flagger that uses Bayesian Inference. This are my very first steps in ML, and Naive Bayes is a perfect starting point. I built it using The Spam Assassin Email Classification Dataset I built the frontend with Next.js (TypeScript) and TailwindCSS for the styling, and I used Python's FastAPI for the backend. I didn't really need to use any machine learning library.

Usage

It's pretty straightforward, you just need to paste text and then you can check the probability of an email being a spam by clicking the analyze button.

Capture d'écran 2025-12-14 155310 image

API

POST /

Returns the probability of an email being spam in the format: label: spam | not spam ; score: number/100 (the body should be in the JSON format "text" : "your text") image

Installation

Prerequisites

You need to have npm and python installed on your machine.

Frontend

cd frontend && npm install

Backend

cd backend && python3 -m venv .venv && pip install -r requirements.txt

How It Works

The classifier uses a Naive Bayes approach:

  1. Tokenizes email text
  2. Computes word probabilities from the dataset
  3. Applies Bayes' theorem
  4. Outputs spam probability

Acknowledgments

Spambusters was inspired by a podcast by Micode featuring Fabien Pinckaers, the creator of Odoo. He was talking about how "not every task needs an openai api call", because sometimes there are algorithms that take up way less time compared to using ai. One of them is Naive Bayes which is what I used here.

Useful links

About

A spam email flagger that uses bayesian inference. Uses The Spam Assassin Email Classification Dataset

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages