PHP Classes

Bayesian Spam Filter: Detect spam in text using Bayesian techniques

Recommend this page to a friend!
  Info   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 74%Total: 4,955 All time: 544 This week: 88Up
Version License PHP version Categories
bayesianspamfilter 1.1BSD License4.0Text processing, Artificial intelligence


This class can be used to detect spam in text messages using Bayesian techniques.

It analyzes the text words in terms of n-grams in a way that is idiom independent.

It can be trained to progressively distinguish what is spam and what is not spam by detecting patterns in training samples. Training data is stored in a MySQL database.

Innovation Award
PHP Programming Innovation award nominee
December 2007
Number 3
Determining whether a message is spam or not, is a subjective task.

Using Bayesian techniques it is possible to make a computer program learn what can be spam and what may not be spam.

A program may be trained using sample messages and telling it which are spam. Once the program is well trained, it may start guessing what is spam all by itself.

This package implements solution written completely in PHP that uses Bayesian techniques to detect spam text messages.

Manuel Lemos
Picture of Cesar D. Rodas
  Performance   Level  
Name: Cesar D. Rodas is available for providing paid consulting. Contact Cesar D. Rodas .
Classes: 38 packages by
Country: Paraguay Paraguay
Age: 36
All time rank: 71 in Paraguay Paraguay
Week rank: 33 Down1 in Paraguay Paraguay Equal
Innovation award
Innovation award
Nominee: 25x

Winner: 5x

  Files folder image Files  
File Role Description
Files folder imageexample (5 files)
Plain text file ngram.php Class N-gram class
Plain text file spam.php Class Spam detection class
Accessible without login HTML file spamdetection.html Doc. General information about this class
Plain text file trainer.php Class Spam trainer class

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file test.php Test Testing script
  Accessible without login Plain text file base.sql Data Example of Spams and mysql table to save the knowledge
  Accessible without login Plain text file config.php Conf. Example
  Accessible without login Plain text file example.php Example Classification example
  Accessible without login Plain text file example_trainer.php Example Example of how to traine the spam database

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:544
This week:88Up
 User Ratings  
 All time