WhichX
WhichX is a Naive Bayes' Classifier written in Javascript for classifying short text descriptions into categories. It is a very small library with a very simple API and no dependencies. To see a working demo you can also go to http://www.rudikershaw.com/articles/whichpet.
Installation
$ npm install whichx
Usage
If you are using Node start by requiring whichx.
var WhichX = require("whichx");
Simply define a new WhichX object. This object represents your dataset, the labels that you want your data classified into, as well as the means to add and classify descriptions.
var whichpet = new WhichX();
After this you will want to add the labels you wish to give to the types of descriptions you wish to classify.
var labels = ["cat","dog","fish","horse","bird","reptile"];
whichpet.addLabels(labels);
whichpet.addLabels("pokemon");
Now you can add descriptions to each label. These descriptions, with their labels, act as your training set data.
whichpet.addData("pokemon", "loyal and bright yellow with a lightning shaped tail");
With enough data (the more the better), you can provide a description on it's own and ask the classifier which label it thinks it belongs to.
var pet = whichpet.classify("Its yellow and shoots lightning");
console.log("It's a " + pet + "!");
That's it. Enjoy.