Skip to content

Java Implementation: Bag of Words with Naive Bayes

Notifications You must be signed in to change notification settings

davidromero/Bag_of_Words

Repository files navigation

Description

Bag of words classification project using a Naive Bayes probabilistic model. The program takes a text file to train itself, counting every word associated with the tag and it calculates the probability of an outcome given a word.

Quickstart

alt text

To use the program, select a text file with the 'Choose training file' button and with the following structure and hit 'Run':

rainy    hot    high    false   | no
rainy    hot    high    true    | no
overcast hot    high    false   | yes
sunny    mild   high    false   | yes

The left side represents words associated with the right side word.

When the program has calculated all the words probability the results will be available at the left side of the window. alt text

Finally you can enter a phrase and click 'Clasify' to get the most likely outcome with some additional information. alt text

After each classification the program will change it's probability by saving the words of the phrase to the training set. The calculations use Laplace smoothing of a value of 1.

Releases

No releases published

Packages

No packages published

Languages