Rasa Actions: adapt answer based on numeric value in response

Hi!

I would like to personalise bot responses based on percentage ranges. Say the intent is ‘result’ (e.g., I got 98%; my result was 78 percent). Depending on the numeric value of that intent, the bot should provide a different response. How can I do this in Python Actions? Should I use slots? How to recognise the numeric value of an intent and trigger a response based on its value? Also, how can rasa handle % or percent ?

Thanks

I would use Duckling to extract the # and a custom action to check the value of the slot & respond accordingly.

Alternatively, you could us a conditional response variation: Now Available in Rasa Open Source: Conditional Response Variations

1 Like

Thanks for your response, I will try this. But will this work if user says “my result was seventy eight percent” without an explicit number written? Also I want this to be voice-based instead of text-based, so am wondering whether Duckling + Custom Action will be the best approach?

Duckling should also be able to handle numbers written out (in languages it supports). :slight_smile: