1

I am wondering what is the ideal way to define entities of different kinds with interval value. e.g. with maximum and minimum number.

I tried to define a number-intervalentity with min and max values. Then defined a price-range composite entity with @number-interval + @sys.currency-name. (See attached images)

There are two issues with this. First, there are too many ways for user to say it. For instance, it can recognize User says: above 12 USD but can not recognize User says: more than 12 USD

Is there any better way to define it that uses system entities?

For example, let's say we want to collect two different values from user.

The other problem is, let's say we want to collect two different kind values from user. How to distinguish the correct entity (price_range vs. size_range)?

Example:

  1. user says: 1200 to 1500 in get_price action. should return @price-range
  2. user says: 9-10 in get_size action. should return @size-range

P.S. Entities:

  1. enter image description here
  2. enter image description here
Hamid Bazargani
  • 847
  • 1
  • 15
  • 30
  • Your question may be answered at https://stackoverflow.com/questions/43568187/best-way-to-handle-ranges-in-api-ai. Good luck! – qnguyen Aug 03 '17 at 06:16

1 Answers1

0

There's currently no range/interval system entity (all Dialogflow system entities can be found here)

To answer the second part of your question: Get 2 different kinds of values from the user. You can use contexts to narrow down the options (see documentation)

  • Question: "What is the price?" (output context: price)
  • Answer: "10-50" (context: price)
  • Intent get_price (input context: price) <- this will trigger
  • Intent get_size (input context: size) <- this will never trigger

Only an intent with the same context can trigger. If an intent doesn't have an input context it can always trigger (for example a "help" intent without a context).

lisa p.
  • 2,138
  • 21
  • 36