javascript - Make chatbot (wit.ai) reply that it doesn't have a proper answer - Stack Overflow

I am using Wit.ai for my chatbot. The problem is that my bot always tries to answer something. I will o

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 badges
Add a ment  | 

3 Answers 3

Reset to default 4

Right 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! :)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745380930a4625221.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信