3

I'm using Luis for the first time to try to create an intent on an ecommerce store which recognises product categories and their sub categories.

The first requirement is that it can answer the following queries

"Show me some jeans" "Show me some bootcut jeans"

So, obviously it will show products from the main category or sub categories depending in what it detects. The second requirement is that it recognises...

"Show me some dark jeans"

In this instance "dark" isn't a sub-category, it's just a tag or attribute, so an adjective rather than a noun.

So far I've created an intent and tried various ways of creating the sub categories as entities. The obvious way seems to be hierarchical but this seems to assume that the child entities are the same no matter what the parent entity is. This obviously isn't right because the sub-categories of jeans are different from the sub-categories of dresses.

I haven't even made it as far as making entities from all the tags but I'd really appreciate any advice.

jonhobbs
  • 26,684
  • 35
  • 115
  • 170

1 Answers1

1

You can try to solve this by using composite entities. In the example from the documentation, the composite entity has a parentType of Order, which associates 2 child entities - number and location.

I quickly opened up the LUIS portal and tried to re-create your scenario by creating an composite entity of type Pant, with 2 child entities (simple entities), type and jean.

enter image description here

After you create your entities and associated hierarchies, you can wrap/tag them in your intents, as you train your language model.

enter image description here

I hope this helps!

Matthew S
  • 308
  • 1
  • 15
  • Thanks. So in your example, "type" could be any adjective, small, blue, flowery etc. and would still get recognized, whereas "jean" could be a defined list of sub-categories? – jonhobbs Apr 09 '18 at 20:37
  • I personally haven't tried that, but I would consider adding another entity, say 'color' - basically a different entity for each type of attribute. Another thing you can try is to use list-entities - [see this post](https://blog.botframework.com/2018/01/16/luis-quick-start-list-entities/). Using list entities a user can type something in multiple ways, and you can have it still resolve to the same item. I think I understand what you're trying to do, but LUIS isn't really intended to handle that much application logic on it's own, at least with it's current feature set. – Matthew S Apr 09 '18 at 20:59
  • You could also try using hierarchal entities? I haven't tried wrapping a heirarchal entity under a composite entity, but now i'm curious to try! – Matthew S Apr 09 '18 at 20:59
  • Thanks, I'd read about all the types of entities but couldn't see which combination was right for recognizing sub-categories and "tags", still not sure my understanding is quite there but you've given me some ideas. – jonhobbs Apr 09 '18 at 21:11
  • how do we see sub entities in the response ? – Gel Jun 27 '22 at 18:41