I'm using node-nlp to create a chatbot for helping a user to book a package/trip and I want to extract destination_name, start_date, end_date, adults and children from utterances. Currently, I'm using the following approach :
nlp_manager.addDocument('en', 'planning %destination_name% from %start_date% till %end_date% with %adult% parents and %child% kids','book_package');
nlp_manager.addDocument('en', 'visiting %destination_name% from %start_date% to %end_date% with %adult% adult and %child% childs','book_package');
And for pulling entities I'm using trim named entities :
const destination_name = manager.addTrimEntity('destination_name','trim');
destination_name.addBetweenCondition('en', 'visit', 'with');
destination_name.addBetweenCondition('en', 'visit', 'from');
destination_name.addBetweenCondition('en', 'going to', 'from');
destination_name.addBetweenCondition('en', 'going to', 'with');
destination_name.addBetweenCondition('en', 'packages to', 'with');
destination_name.addBetweenCondition('en', 'package to', 'with');
destination_name.addBetweenCondition('en', 'package to', 'from');
const adult = manager.addTrimEntity('adult','trim');
adult.addBetweenCondition('en','with','adults and');
adult.addBetweenCondition('en','and','adults');
const child = manager.addTrimEntity('child','trim');
child.addBetweenCondition('en','and','childs');
child.addBetweenCondition('en','with','childs and');
const start_date = manager.addTrimEntity('start_date','trim');
start_date.addBetweenCondition('en','from','to');
start_date.addBetweenCondition('en','from','till');
const end_date = manager.addTrimEntity('end_date','trim');
end_date.addBetweenCondition('en','to','with');
end_date.addBetweenCondition('en','till','with');
After training the model and giving the bot an utterance the NER manager is not able to extract the entities from the utterance. An example of utterance :
i am planning to visit europe from 21 june to 25 june with 2 adults and 3 childs
Can you suggest a better way of doing it. Here's a link to the package https://www.npmjs.com/package/node-nlp