$ npm install whichpet
If you are using Node start by requiring whichpet.
var Whichpet = ;
Simply define a new Whichpet 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.
// Define your whichpet object.var whichpet = ;
After this you will want to add the labels you wish to give to the types of descriptions you wish to classify.
// Define an array of labels for description types.var labels = "cat""dog""fish""horse""bird""reptile";// Add your labels to the whichpet object.whichpet;// Add an extra single label to the whichpet object.whichpet;
Now you can add descriptions to each label. These descriptions, with their labels, act as your training set data.
// Add a description and its label to the data set.whichpet;// ... Add more here.
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.
// Which pet am I talking about?var pet = whichpet;console;
That's it. Enjoy.
whichpet.js (located in
assets/scripts) is where all the logic is and the rest (in
assets/example) of the project serves only as an example of how the
whichpet.js can be used. In the
To get starting making changes to the project you will need to;
- Install node and npm.
npm installin the root of the project.
npm test -sto run the linters and unit tests.
As long as any changes you make pass all linting checks and unit tests, feel free to raise a pull request.