Search code examples
botframeworkbotsazure-language-understanding

Microsoft Bot Framework: LUIS hierarchical vs list entity


I have created a sandwich order bot following instructions from the Microsoft tutorial. My goal is now for this bot app to interact, so I will be using the Language Understanding (LUIS) service API to achieve this.

In the sandwich chat the user can select what they want to add, eg. salad, sauce etc.

I am unsure if I should be using LUIS hierarchical or list entities for this.

Here is what I have with LUIS entities:

  • Composite entity
    • Sandwich
  • Hierarchical entities
    • Salad: Lettuce, Olives
    • Sauce: Mayo, Ketchup
    • Cheese: Blue, Cheddar

Here is what I have with list entities:

  • List Entities
    • Salad: lettuce, Tomato, olives
    • Sauce: Mayo, Ketchup
    • Cheese: Cheddar, blue

I am not sure how to create the relationship between the sandwich and the sandwich fillings. Also, if it should be list or hierarchical.

Thank you for your time, appreciate it!


Solution

  • List entity is an exact match of text. You can add many items but they all have to be known before hand to add to the list entity.

    Hierarchical entities are simple entities with context between the child/simple entities. This allows LUIS to learn more sandwich fillings without you having to add them to the list entity.

    The true answer is if you have a hard set list of fillings, use the list entity. If you want your customer to be able to add anything, use a simple, hierarchical, and/or composite entity with a phrase list of fillings to boost the signal that those are sandwich filling words.