1

I'm trying to build a chatbot which requires large number of entity values to be added in the knowledge base (or at least I think it is).

Assume user just say a name of restaurant and we need to provide its details, like location, ratings, menu etc. So how can I make wit.ai to understand names without actually saving all available values.

Vinit Yadav
  • 51
  • 1
  • 4

1 Answers1

2

Great question. It really depends on the number of values.

For values that don't change a lot (restaurants for example), you can use the HTTP API to add values programmatically to your app: https://wit.ai/docs/http/20160526#post--entities-link. They you will probably want to turn your entity as free-text&keyword. This is where it will be very important to validate expressions and tag the restaurant entity in these expressions. The more examples of queries you validated, the better Wit will be at guessing new values. A very simple example to help understand: if you validated "I want to book a table for 2 at BLABLA", "I need book a table at BLIBLI"... with BLABLA and BLIBLI as restaurant entities, Wit will be able to guess after enough examples that "Toto" is probably a restaurant entity value in the following expression "need to book a table at Toto" even if you never valided "Toto" as a restaurant value.

For values that change a lot over time (movies), you will probably want to use a free-text entity. Again this is where it will be very important to validate expressions and tag the restaurant entity in these expressions. The more examples of queries you validated, the better Wit will be at guessing new values. On your side, you will get a value that could be a movie but you will have to check that this is actually a real movie on your code.

More info on entities here: https://wit.ai/docs/recipes#which-entity-should-i-use

l5t
  • 578
  • 2
  • 5
  • Thanks for the answer. – Vinit Yadav Jul 22 '16 at 06:26
  • I need bit more clarification. Assume user say "I want to dine at ABCD tonight, reserve it for 2", and assume this is completely new expression for Wit (I know I can train it for this as well), but not for all possible expression (at least in initial version of my bot). So how I make sure that Wit identifies ABCD as a restaurant name. Uploading all such entity value to Wit is the only solution? Also in case of movies, if user just send a movie name (without any sentence) like "Ex Machina", how do I make sure Wit identifies it. – Vinit Yadav Jul 22 '16 at 06:36
  • I suppose in the case of "Ex Machina" it will only be identified in Wit.ai if it's a predefined entity value. Otherwise it could be anything, how should Wit know? Then again you could somehow intercept the message before it goes to Wit.ai, and search for the text that you get in your data storage if there is an "Ex Machina". Then don't forward it to Wit.ai because you already know that it's that kind of entity (movie). – Klemens Zleptnig Jul 25 '16 at 18:20