Response is empty for text containing entity

  • I trianed my rasa model, i am able to get the response for normal inputs.
  • When I give sentence which contains entity, the response is empty.

nlu.md

## intent:defect_quantity
- what is the defect quantity for [2018](year)

stories.md

## get defect quantity 01
* greet
  - utter_greet
* defect_quantity
  - utter_defect_quantity
* goodbye
  - utter_goodbye    

user input

hi
what is the defect quantity of 2017
bye

bot response

[{'recipient_id': 'default', 'text': 'Hey there! Wassup?'}]
[]
[]

I do not know why I am getting empty response when the entity is present in the input.

This is likely because your defect_quantity intent is featurizing the entities, so you are on a story path not covered in your stories. You have 2 options:

if whether or not the entity is picked up matters, (i.e. if they don’t provide it you should ask for it), you would want to do something like

## get defect quantity 01
* greet
  - utter_greet
* defect_quantity{"year": 2018}
  - utter_defect_quantity
* goodbye
  - utter_goodbye    

## get defect quantity 01
* greet
  - utter_greet
* defect_quantity
  - utter_ask_year
* inform{"year": 2018"}
  - utter_defect_quantity
* goodbye
  - utter_goodbye    

if the same action is performed regardless of if you provide a year or not, then you can unfeaturize entities for the intent:

intents:
- defect_quantity:
    use_entities: []

which essentially does the same as providing the story

## get defect quantity 01
* greet
  - utter_greet
* defect_quantity OR defect_quantity{"year": 2018}
  - utter_defect_quantity
* goodbye
  - utter_goodbye    

but for all possible entities and combinations of entities.

Thank you for the response. I followed the last approched and now it respond the standard output message. But i am not pass the value with the response. Take for example 1000 is the defect quantity , I am not able to pass them as the response. how to pass the value 1000 using dispatcher. I used dispatcher.utter_message() but i am not getting this in response for the agent.handle_text()

Can you post an example of how you are using the dispatcher to utter it, as well as the response you are receiving and the response you want to receive?