admin管理员组文章数量:1425745
I am using Wit.ai
for my chatbot. The problem is that my bot always tries to answer something. I will only make my bot answer if it actually understood what was being asked. I know it is possible, but if I have a bot with very few replies, it seems it always chooses one of the replies even though it is asked something pletely different.
I imagine it is possible to make it reply something like "I am sorry. I don't know what you are asking. I can help you with .....".
Maybe I should use the confidence value that I can retrieve, and make sure it's above some threshold?
I am using Wit.ai
for my chatbot. The problem is that my bot always tries to answer something. I will only make my bot answer if it actually understood what was being asked. I know it is possible, but if I have a bot with very few replies, it seems it always chooses one of the replies even though it is asked something pletely different.
I imagine it is possible to make it reply something like "I am sorry. I don't know what you are asking. I can help you with .....".
Maybe I should use the confidence value that I can retrieve, and make sure it's above some threshold?
Share Improve this question asked Jul 12, 2016 at 16:41 JamgreenJamgreen 11.1k32 gold badges122 silver badges232 bronze badges3 Answers
Reset to default 4Right now the best way to deal with this problem is to create one or more stories with out-of-scope requests, and add a "catchall" entity with strategy "trait" to the user message (more details here).
In the simplest case, your "catchall" entity will have a single value. You could have several values, for example if you want different kind of answers for different kind of out-of-scope requests, but keep in mind that the more plex your bot is, the more stories and data you will need to have to make it working correctly.
We are also working on a more elegant solution. Stay tuned here: https://github./wit-ai/wit
A simple solution is to create a story without intent, with the bot answering something like "I don't understand"
This story will be started when no other intent is relevant. It works pretty well according to our experience.
You can create some function to handle intent of the user-input message.
function handleIntent(intent, sender) {
switch(intent) {
case "jokes":
//Do Something
break;
case "greeting":
//Do Something
break;
case "identification":
//Do Something
break;
case "movie":
//Do Something
break;
default: // Any other intensions go here..
sendTextMessage(sender, "I couldn't understand that one :(")
break;
}
}
Hope the idea helps! :)
本文标签: javascriptMake chatbot (witai) reply that it doesn39t have a proper answerStack Overflow
版权声明:本文标题:javascript - Make chatbot (wit.ai) reply that it doesn't have a proper answer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745380930a2656157.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论