/Spam-Email-Classifier

Classifies an email as either spam or ham

Primary LanguageJava

Spam-Email-Classifier

About

  • This is a spam filter that flags a message as spam or ham.
  • A message is classified based on the number of spam words present.
  • A fixed number of spam words are stored in a trie and through string matching the number of spam words in a message can be decided
  • This is a naive approach to spam filtering

How to Use?

  • Download the code files and text files present in this repository
  • Ensure to change file location in the code, to your local folders
  • Create two seperate folders called - Spam and Ham
  • Update their file locations in the code
  • Run Spam_Filter.java

Directory Contents

  • Code: Contains the file Spam_Filter.java
  • Text Files: Contains one text file called Spam Words and another folder called Test Files that contains sample text files for execution