wit icon indicating copy to clipboard operation
wit copied to clipboard

Add support for number ranges

Open PAK90 opened this issue 3 years ago • 3 comments

Do you want to request a feature, report a bug, or ask a question about wit? Feature

What is the current behavior? Numbers can't have ranges.

What is the expected behavior? Numbers should have ranges, like wit/amount_of_money

Oddly, I asked for this exact feature years ago in this issue. It has been closed and so has the relevant duckling issue. But in today's wit.ai, I still cannot see ranges as supported by wit/number. Is this a hidden feature/setting somewhere, or it's simply never made it into the wit.ai site?

PAK90 avatar Jan 17 '23 02:01 PAK90

What would you expect to happen if the user says a number that's outside the given range? Or did you mean you want it to resolve to a range?

MokhtarKhorshid avatar Jan 17 '23 19:01 MokhtarKhorshid

I want to have a number entity, for example from the sentence more than 90 seconds. This currently just picks out 90 as a number, for which I can't declare a range. It'd be good to have it behave like wit/amount_of_money does, where you can do less than $5 and it picks up the range and currency.

PAK90 avatar Jan 17 '23 22:01 PAK90

hey @PAK90, this isn't supported at this point. But like wit/amount_of_money, wit/number is supported by Duckling - so feel free to take a stab at it and submit a PR! One caveat is that many other dimensions are built on top of the Numeral dimension, so we'd need to move the implementation of ranges from that higher dimension to the lower one.

patapizza avatar Jan 18 '23 16:01 patapizza