Some context: Node.js, Bot, natural module.
I would like to build a Bot and I am using the natural module in order to parse and overall classify the user input.
var classifier = new natural.BayesClassifier();
classifier.addDocument('Hi', 'welcome');
classifier.addDocument('Hello', 'welcome');
classifier.addDocument('Hey', 'welcome');
classifier.addDocument('Good', 'welcome');
...
//back to home
classifier.addDocument('go back to home', 'back2home');
classifier.addDocument('go back home', 'back2home');
classifier.addDocument('return', 'back2home');
classifier.addDocument('return to home', 'back2home');
...
classifier.train();
...
classifier.classify(text);
Those tests work fine:
"I would like to go back home" => back2home
"Hi" => welcome
All good, but what if the user text contains something such as: "bla bla bla", I want to get a way to know that the that the text not fits enough in any of the above cases. "bla bla bla" returns me => welcome, but actually i would like it return something such "unknown"/not understood.
It is a way to "train" the classifier in such a way? Thanks.