Reputation: 15136
I want to define an intent PlaceReservation
that would capture a restaurant reservation. The parameters for that would be numOfPeople
and time
. Both of those parameters are optional, so a user can say:
My problem is with the last one, get a table for 5 for 9pm
the intent then captures 5 as the hour (5am) and ignores 9pm.
time
is defined as a @sys.time
system entity.
Is there a way to tell it to not accept simple integers as time, as I think this is what is confusing it?
Is there some other solution I'm missing? I certainly understand why it is making the mistake, but we, as humans understand how to interpret it, and I want to help DialogFlow interpret it accordingly.
Upvotes: 1
Views: 672
Reputation: 888
This is definitely confusing for the bot to understand/interpret which one is time & which one is the number of people. Even creating a separate entity for time
like 9am/10am
won't work cause this does not guarantee that user will enter 9am/pm
only. They may not append am/pm
ahead of time as well. The solution to your problem can be creating separate intents, first asking users for time & then for number of people. This way you reduce the complexity & can train the bot in a proper way. In addition, you can direct user to a certain direction instead of keeping your bot open for questions.
Upvotes: 0
Reputation: 498
I've had a similar problem and haven't found a proper solution for it yet. In your case you could define your own time entity that consists of entries like 9pm or 10am or even expand it with a composite entity to also let users say "10 in the morning" https://dialogflow.com/docs/entities#dev_composite.
Upvotes: 1