All Projects → varunon9 → naive-bayes-classifier

varunon9 / naive-bayes-classifier

Licence: MIT license
Implementing Naive Bayes Classification algorithm into PHP to classify given text as ham or spam. This application uses MySql as database.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to naive-bayes-classifier

Nepali-News-Classifier
Text Classification of Nepali Language Document. This Mini Project was done for the partial fulfillment of NLP Course : COMP 473.
Stars: ✭ 13 (-38.1%)
Mutual labels:  classifier, naive-bayes-classifier
bayes
naive bayes in php
Stars: ✭ 61 (+190.48%)
Mutual labels:  classifier, naive-bayes-classifier
sentiment-analysis-using-python
Large Data Analysis Course Project
Stars: ✭ 23 (+9.52%)
Mutual labels:  classifier, naive-bayes-classifier
lapis-bayes
Naive Bayes classifier for use in Lua
Stars: ✭ 26 (+23.81%)
Mutual labels:  classifier, naive-bayes-classifier
chatto
Chatto is a minimal chatbot framework in Go.
Stars: ✭ 98 (+366.67%)
Mutual labels:  classifier, naive-bayes-classifier
Water-classifier-fastai
Deploy your Flask web app classifier on Heroku which is written using fastai library.
Stars: ✭ 37 (+76.19%)
Mutual labels:  classifier
Bag-of-Visual-Words
🎒 Bag of Visual words (BoW) approach for object classification and detection in images together with SIFT feature extractor and SVM classifier.
Stars: ✭ 39 (+85.71%)
Mutual labels:  classifier
tensorflow-image-classifier
Easily train an image classifier and then use it to label/tag other images
Stars: ✭ 29 (+38.1%)
Mutual labels:  classifier
Telegram-collector
Collect all telegram chat users
Stars: ✭ 52 (+147.62%)
Mutual labels:  spam
migrate-Java-EE-app-to-azure
Migrate an existing Java EE workload to Azure
Stars: ✭ 12 (-42.86%)
Mutual labels:  mysql-database
php-search-all-database
With this code, you can search all database with narrowing down the Tables & Column to search in, Resulting in low traversing & high performance
Stars: ✭ 21 (+0%)
Mutual labels:  mysql-database
Mr.Holmes
🔍 A Complete Osint Tool
Stars: ✭ 307 (+1361.9%)
Mutual labels:  spam
TLG AntiJoin2SpamBot
Telegram Bot that figths against Spammers who join groups to publish their annoying and unwanted info. The Bot will watch for all new users that join the group and don't let them to publish messages that contains URLs until they have been in the group long as an specific time, and they have written an enough number of messages (configurable).
Stars: ✭ 16 (-23.81%)
Mutual labels:  spam
creek
使用Spring Security + JWT Token + RBAC的方式实现认证和授权,持久层使用Mybatis plus。避免每次重复编写认证和授权功能、角色管理、异常处理、参数校验等代码,直接上手业务代码,不再烦恼于构建项目与风格统一。
Stars: ✭ 21 (+0%)
Mutual labels:  mysql-database
NN-scratch
Coding up a Neural Network Classifier from Scratch
Stars: ✭ 78 (+271.43%)
Mutual labels:  classifier
Machine-Learning-Projects-2
No description or website provided.
Stars: ✭ 23 (+9.52%)
Mutual labels:  naive-bayes-classifier
Musical-World
DBMS Mini Project that basically designed for online music player
Stars: ✭ 59 (+180.95%)
Mutual labels:  mysql-database
twitter mining
Twitter Mining in Java
Stars: ✭ 25 (+19.05%)
Mutual labels:  naive-bayes-classifier
Instagram-Giveaways-Winner
Instagram Bot which when given a post url will spam mentions to increase the chances of winning. Win Instagram Giveaways!
Stars: ✭ 95 (+352.38%)
Mutual labels:  spam
ML4K-AI-Extension
Use machine learning in AppInventor, with easy training using text, images, or numbers through the Machine Learning for Kids website.
Stars: ✭ 18 (-14.29%)
Mutual labels:  classifier

Naive Bayes Classifier

Implementing Naive Bayes Classification algorithm into PHP to classify given text as ham or spam using MySql database.

How to use

<?php

    require_once('NaiveBayesClassifier.php');

    $classifier = new NaiveBayesClassifier();
    $spam = Category::$SPAM;
    $ham = Category::$HAM;

    $classifier -> train('Have a pleasurable stay! Get up to 30% off + Flat 20% Cashback on Oyo Room' . 
            ' bookings done via Paytm', $spam);
    $classifier -> train('Lets Talk Fashion! Get flat 40% Cashback on Backpacks, Watches, Perfumes,' .
            ' Sunglasses & more', $spam);

    $classifier -> train('Opportunity with Product firm for Fullstack | Backend | Frontend- Bangalore', $ham);
    $classifier -> train('Javascript Developer, Fullstack Developer in Bangalore- Urgent Requirement', $ham);

    $category = $classifier -> classify('Scan Paytm QR Code to Pay & Win 100% Cashback');
    echo $category; // spam
    
    $category = $classifier -> classify('Re: Applying for Fullstack Developer');
    echo $category; // ham

?>

How to install the project-

  1. Download the project and extract zip.

  2. Create database in MySql-

    1. mysql> create database naiveBayes;
    2. mysql> use naiveBayes;
    3. mysql> create table trainingSet (S_NO integer primary key auto_increment, document text, category varchar(255));
    4. mysql> create table wordFrequency (S_NO integer primary key auto_increment, word varchar(255), count integer, category varchar(255));
  3. Open a terminal and move to project folder

  4. Edit database connection info in db_connect.php file

  5. Execute main.php php main.php

Database Schema

Database Schema

Blog

https://medium.com/@varunon9/classify-emails-into-ham-and-spam-using-naive-bayes-classifier-ffddd7faa1ef

For any bug/mistake you can create github issue. Contact [email protected] for suggestion/query.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].