1

I am creating a bot for real estate.

Now in real estate, user may enter any locality or society, which right now is more than 100 000 in database.

To get it resolved as entity, one solution is that I enter all societies/localities as developer entities in system. But, this might not be scalable.

Can you suggest how to approach this problem?

Is this the usecase of sys.any entity?

Tejas Bramhecha
  • 880
  • 5
  • 19
vipul
  • 114
  • 1
  • 7
  • Dialogflow may already have an entity for your use case: there are already Dialogflow system entities for addresses, capitals, countries, cities, zip codes, states and locations: https://dialogflow.com/docs/reference/system-entities#geography – mattcarrollcode Feb 07 '18 at 16:54
  • It have entries for famous cities and localities across world. We have very specific socities use case too which are unique to our database only. – vipul Feb 08 '18 at 06:41
  • If you need to connect your bot to a database you'll need to use Dialogflow fulfillment: https://docs.dialogflow.com/fulfillment – mattcarrollcode Feb 13 '18 at 17:56

1 Answers1

0

I can see only one solution to your problem. You can not expect to enter 1,00,000 locality names as an entity in api.ai & this is not a generalized solution as well. What you can do is create an intent & use @sys.any built-in entity for user expressions. Write a webhook & enable use webhook option for that intent. You can get user entered locality as a parameter in webhook & check it in database if it is present over there. If yes, you can give real-estate details for that locality as a response or else say, please enter a valid locality name.

Tejas Bramhecha
  • 880
  • 5
  • 19
  • That Particular intent is Search Intent. User can type "Noida Expressway Properties"/ "2 bhk apartment in Noida Expressway" / "apartments in bangalore " / "Noida Expressway" Here user have the freedom to write other search entities like budget, property type instead of locality/society. For eg "3 bhk properties" / "apartment in budget of 50 lacs" / "flats" So, usin @sys.any can confuse API AI whether to take it as locality/society entity or any other search entity – vipul Feb 15 '18 at 06:08
  • Using `search intent` with all these hodgepodge won't work. Instead what you can do is direct user to a certain direction. Ideally the workflow would be: 1. Ask user what he is looking for (Apartments/Bunglow/flat/cottage) 2. Then ask him if he wants to buy/rent a property. 3. Now, you can ask him if he has cheaper/expensive budget. 4. Accordingly go on asking him for money-range he can invest if he wants to buy or rent he is willing to pay if he wants it on rental basis. 5. & so on. This would certainly resolve your issue & this way you do have to keep bot open ended for user. – Tejas Bramhecha Feb 15 '18 at 06:29
  • See, there's one more disadvantage of this using @sys.any will take whole string coming its way which will again increase an overhead. – Tejas Bramhecha Feb 15 '18 at 06:29
  • Agreed and workflow is like this only. But during user testing, maximum users are typing sentences as mentioned above and then they are complaining, that why I am being asked budget/bhk as I have entered it already. To prevent this, I supported "hodgepodge" too since user behavior is like this. – vipul Feb 15 '18 at 11:10
  • See if user is asked a question, what are you looking for & given buttons/quick-replies to select an option, why would someone enter the whole description. He will have to anyway select an option or explicitly write, Apartments/Bunglow/flat/cottage. Set the contexts so that each intent is bind to each other. This is how you drive a user & even if user enters anything beyond the point, fallback intent will be called. – Tejas Bramhecha Feb 15 '18 at 11:17