0
votes

I have a word for example ABC SSS. I need this to be recognised as one entity. At the same time this ABC SSS phrase precedes a lot of other words that need to be recognised as one entity which are not interchangeable. For example ABC SSS word. How can I train LUIS to be able to do this. I tried ABC SSS as a phrase feature but then LUIS doesn't recognise ABC SSS word as an entity. Currently, I marked ABC SSS as a feature phrase and word as a separate feature phrase. This is not ideal. Thanks for your help.

2

2 Answers

2
votes

You'll want to create composite entities, not use phrase lists for this.

Here's a screenshot of the entities creation page on LUIS. I've created three simple entities and one composite entity which takes the other three entities:

Entities

Here are some snippets from a response I got from LUIS on a query. This first bit indicates the actual query and matched intent.

"query": "order large pepperoni pizza",
"topScoringIntent": {
    "intent": "OrderPizza",
    "score": 0.9999995
},

Under the entities list you'll find your simple and composite entities together, like the following.

{
    "entity": "large",
    "type": "PizzaSize",
    "startIndex": 6,
    "endIndex": 10,
    "score": 0.9186653
},
{
    "entity": "large",
    "type": "Pizza", // This is the composite entity!
    "startIndex": 6,
    "endIndex": 10,
    "score": 0.940835536
}

And here is the list for composite entities:

"compositeEntities": [
    {
      "parentType": "Pizza",
      "value": "large",
      "children": [
        {
          "type": "PizzaSize",
          "value": "large"
        }
      ]
    },
    {
      "parentType": "Pizza",
      "value": "pepperoni",
      "children": [
        {
          "type": "PizzaTopping",
          "value": "pepperoni"
        }
      ]
    },
    {
      "parentType": "Pizza",
      "value": "pizza",
      "children": []
    }
]
0
votes

Composite Entities are ideal for this case:

Set "ABC SSS" as an entity 1, but then tag "ABC SSS" plus those other words into a composite entity 2. This should be enough to both capture "ABC SSS" as entity 1 and the whole sentence as entity 2 in the case those other phrases appear.

Also, you can also tag those other words as Entities by themselves if you want to capture them while you are on it.