smallclassifier

Classifier is one of the easiest methods of text classification

Usage no npm install needed!

<script type="module">
  import smallclassifier from 'https://cdn.skypack.dev/smallclassifier';
</script>

README

Small Classifier

Small classifier is a lightweight and easy to use text classifier.

Training

var Classifier = require('Smallclassifier');
var classifier = new Classifier();
classifier.train('Hello there', 'greeting');
classifier.train('SmallClassifier is awesome!', 'complement');

Use

console.log(classifier.classify('hello there SmallClassifier')); // greeting
console.log(classifier('You are awesome!')); //{"complement": 0.66666666666, "greeting": 0.33333333333}