Dear colleagues, we have two questions:
1. we want Rasa to extract quantity in phrases like
I want to order two cups of tea and one coffee
We have the phrase like this in our config /nlu/order.yml:
version: "2.0"
nlu:
- intent: orderdrink
examples: |
- we want to order drinks
- we want [two]{"entity": "black_tea_qty", "value": "2"} [tea]{"entity": "order_black_tea", "value": "true"} and [one]{"entity": "coffee_qty", "value": "1"} [coffee]{"entity": "order_coffee", "value": "true"}
- we want [two]{"entity": "black_tea_qty", "value": "2"} [tea]{"entity": "order_black_tea", "value": "true"}
- we want [two]{"entity": "green_tea_qty", "value": "2"} [tea]{"entity": "order_green_tea", "value": "true"}
- we want [one]{"entity": "water_qty", "value": "1"} [water]{"entity": "order_water", "value": "true"}
...
In above example bot understand correctly and put values int slots:
order_coffe: true
coffee_qty: 1
order_black_tea: true
black_tea_qty: 2
But if we say something like this
we want two tea two green tea and one water
Bot understand only first part (two tea and put values in slots order_black_tea: true, black_tea_qty: 2) and then ask how many cups of green tea? and how many bottles of water? in spite of the fact that we have such phrases in nlu.
Should we put in nlu config the whole phrases for this case:
- we want [two]{"entity": "black_tea_qty", "value": "2"} [tea]{"entity": "order_black_tea", "value": "true"}[two]{"entity": "green_tea_qty", "value": "2"} [green tea]{"entity": "order_green_tea", "value": "true"} and [one]{"entity": "coffee_qty", "value": "1"} [coffee]{"entity": "order_coffee", "value": "true"}
or bot shoul should learn from separate phrases?
Our /stories.yml for order coffee, water and tea :
- story: Order black tea and coffee and water
steps:
- intent: orderdrink
entities:
- order_water # water
- order_black_tea # black tea
- order_coffee # coffee
- slot_was_set:
- order_water: true
- order_black_tea: true
- order_coffee: true
- action: water_order_form
- active_loop: water_order_form
- active_loop: null
- action: black_tea_order_form
- active_loop: black_tea_order_form
- active_loop: null
- action: coffee_order_form
- active_loop: coffee_order_form
- active_loop: null
- action: utter_water_black_tea_coffee_slots_values
- intent: affirm
- action: action_order_drinks
- action: utter_order_confirmed
- action: clear_slots
2. What is the best way to map numbers to slots? We think it is not a good idea to put in nlu config all phrase variations. We found such way: botfront
What is the best practice?
Rasa Version : 2.8.5
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.2
Thanks