General entities and more specific ones

Hi everyone!

I’m struggling with this situation, and don’t know if I am setting up the entities correctly. In my example, the user asks for a list and can provide little details (i.e. asking for a more general list) or provide more details (i.e. asking for a more refined list):

# domain.yml
  - facility_type


# nlu.yml
intent: list_facilities
 - list of [hotels](facility_type)
 - list of [luxury hotels](facility_type)

When the user inputs “I want a list of luxury hotels”, then I get two entities extracted: luxury hotels and hotels.

And tracker.get_slot("facility_type") in the custom action returns only hotels, even though both entities were identified.

Three questions:

  1. Keeping only the facility_type entity, there any way to favor the more specific entity over the more generic one?

  2. Or should I define the entities differently, so that [luxury] is something as a modifier of the facility type?

  3. And moving to a more complex scenario… what if the user wants to further refine the list, such as: “Provide a list of luxury hotels with pool in New York”. Would that call for several modifiers, and what are the recommendations to set up the entities to enable these wider cases?

As I’m starting with Rasa, hope I can get input from more experienced users on what would be the “best practice”.


Hi Patricio!

For this particular use case, I might try using composite entities: NLU Training Data They only work with the DIET and CRF featurizers are the moment but this looks like a good use case.

Thank you Rachael!