$nlp.createClassifier
The function allows you to create a classifier object and use it from a JS-script
How to use
function initClassifier() {
    var c = $nlp.createClassifier("nearest", "examples.json", {"algorithm" : "bow"});
    $global.classifier = c;
}
function answerFromExamples() {
    var text = $jsapi.context().request.query;
    var list = classifier.matchNBest(text, 2);
    log(list);
    list.forEach(function (e) {
        $reactions.answer(e.value + " - " + e.score.toFixed(2));
    })
}