I've installed botman studio on my existing laravel project to create a chat bot. The chatbot works. However, im looking for complex conversations where user can ask chatbot "What is Example" and Chat box searches from the database table and answers back.
I do not find any tutorial or links that can help me get started. Does anyone know how to do this? A simple example could help me
1 Answers
Answers 1
This would be a possible implementation to tipical questions where you listen for the last keyword, so you could configure bot to listen What is + *keyword_to_search*
$botman->hears('What is (^[a-zA-Z0-9_]*$)', function ($bot, $keyword) { $answer = \App\Answer::where('keyword', 'LIKE', $keyword)->get(); $bot->reply('Answer: '.$answer); });
This is extremly simple, you could start chat with --help and list all keywoards that a user can ask for example, it would be kinda cool I guess.
If you would like to implement more complex stuff you could try to learn about Natural Language Processing(NPL), you can read more about it on botman docs.
0 comments:
Post a Comment