1

I followed what is described in the tutorial

  • I first added an Pattern.any entityenter image description here
  • Next, I added a pattern for the required intent enter image description here
  • I had already created an intent like shown and now I click on train enter image description here
  • When I test, the intent is not hit enter image description here

Any idea what's missing?

Nikhil
  • 2,168
  • 6
  • 33
  • 51

2 Answers2

2

TL;DR: Read patterns doc and improve your entity detection.


The Issue

The problem with your example that you have posted here is that LUIS failing to actually detect command_paramsentity, therefore it cannot even match to your any one of those 3 patterns that you have shown.

As stated in Add common pattern template utterance formats to improve predictions:

In order for a pattern to be matched to an utterance, first the entities within the utterance have to match the entities in the template utterance. This means the entities have to have enough examples in example utterances with a high degree of prediction before patterns with entities are successful. However, the template doesn't help predict entities, only intents.

While patterns allow you to provide fewer example utterances, if the entities are not detected, the pattern does not match.

So you need to work on building out your command_params entity to make it detectable before using a pattern.


Your entity

I'm not convinced Pattern.any is the correct entity type for you to use, as it's an entity that's used for values that are of variable length--maybe they are extremely long, for example.

I don't know what type of values your entity can evaluate to, but I suspect it would probably be better to go the route of creating a simple entity + phrase list (uses machine-learning) or a list entity if the entity values are a known set (exact pattern matching), depending on your command params values.

Update: also there are regex entities as well, that may work for you. (Again, I don't know what your entity values could be, so it's hard to point exactly to the correct entity to use)

Additionally, if you need help with understanding how to improve entity detection in general, see this StackOverflow answer.

Community
  • 1
  • 1
Zeryth
  • 1,204
  • 1
  • 7
  • 15
  • How do you get phrase list to work properly? I have never been able to get it to recognize the values in the actual entity. I've always had to create a list entity and add synonyms to the normalized values. – billoverton Apr 22 '20 at 14:01
  • 1
    Pt. 1: Phrase lists are used to "boost" the signal of another entity, but relies on the entity that you are trying to boost a signal for to have enough data to identify it in at least some cases. So let's say you properly have a simple "Apple" entity defined, and LUIS detects values properly like "Golden Delicious" , "Granny Smith", "Cosmic", etc. It could maybe even properly detect a brand new (made-up) apple crop, "Flamingo", even if you did not explicitly label "Flamingo" value as the "Apple" entity in an utterance. – Zeryth Apr 22 '20 at 15:32
  • 1
    Pt 2. LUIS uses machine learning based off the context of utterances to identify "oh yeah, normally an 'Apple' entity can occur here, so 'Flamingo' must be an 'Apple'". "Flamingo" is also an English word, so LUIS has "background" knowledge of this word already (for example, could know based off of the English language that it's a noun, for example). But what if a university created a new apple crop name that did not exist in English--like "Jirio", for example. LUIS has no background knowledge of that word, as it did with "Flamingo". So you could create a phrase list to... – Zeryth Apr 22 '20 at 15:35
  • 1
    Pt 3. ...help identify "Jirio" properly as an "Apple". I can create a new "Apples" phrase list, and include LOTS values like "Golden Delicious", "Granny Smith", "Jirio", etc. And LUIS looks at "I don't know what 'Jirio' is, but I do know what a "Golden Delicious" is. A "Jirio" looks like it's the same thing as a "Golden Delicious" according to the "Apples" phrase list, and thus is more likely to label "Jirio" as an "Apple" entity – Zeryth Apr 22 '20 at 15:39
  • 1
    Pt 4. I give a cell phone example with screen shots in this [StackOverflow post](https://stackoverflow.com/questions/54930061/dispatch-cli-not-passing-entities-from-luis-app), if you want the visuals :) – Zeryth Apr 22 '20 at 15:40
  • 1
    Thanks for the explanation. What I had been missing is that you needed a `simple` entity for phrase lists! I had tried this before with a `list` entity and it didn't work. The simple entity solves my issue of poor performance of patterns to extract entities as well as the broader synonym issue. Very helpful! – billoverton Apr 22 '20 at 15:53
  • One other question, I suppose it isn't possible to combine phrase lists with other entity types? E.g. I have a list entity of truck transmission manufacturers. To use phrase lists as well as get the predictive qualities, I would need to recreate this entity as `Simple` and tag the terms in the actual utterances? – billoverton Apr 22 '20 at 15:56
  • Hmm...I don't see why you wouldn't be able to use another entity with phrase lists? It just needs to be able to have some basis of being able to properly detect the entity in the first place, I think, and be sure to include some of the known list entity values into your phrase list, and I think it might work. If you test it out, let us know the results :D – Zeryth Apr 22 '20 at 15:59
  • I tried a basic example with playType. I can recognize funny/witty/humorour (normalized and synonym values in the entity itself), but other terms in the phrase list are not recognized as entities, though the intent itself is recognized. For example, `I want to watch a hilarious play` is recognized as `watchPlay` intent, but no entities are identified even though funny/witty/humorous are all in the entity and recognized on their own, and hilarious is in the phrase list along with those terms (and others). – billoverton Apr 22 '20 at 16:03
  • As in `I want to watch a funny play`, "funny" is recognized, but "hilarious" is not? Hmm...then it's possible that phrase lists only work with machine-learning entities (simple) entities. Never tried phrase lists w/non-machine learned entities myself – Zeryth Apr 22 '20 at 16:26
  • Going to create a SO post with your question, and copy these comments as answers, so it'll be more easily searchable to the community @billoverton – Zeryth Apr 22 '20 at 16:34
1

The patterns are extremely literal. If the part of the phrase does not match exactly, the intent won't get recognized. (Note: you can add these phrases to the intent directly, instead of in the pattern, in which case it will recognize the intent but not the entities. Can be helpful if you have a dialog to prompt users for the missing entities.)

In your case, the way you have the pattern written you would need to write command create $mytest, which should recognize the intent as well as the entity mytest. Since you did not include the $ character in your test, neither the intent nor the entity was recognized.

You do have the ability to mark a character as optional via brackets [], though I've had mixed success with this. Your phrases are specific enough that it may work in your case. So instead you could make your patterns like command create [$]command_params where both command create $mytest and command create mytest would work and have the correct entity. Do note that if someone types something like command create $mytest please, it's going to pick up the entire phrase mytest please as your entity. (If anyone knows how to create a pattern that avoids this, that would be fantastic!).

billoverton
  • 2,705
  • 2
  • 9
  • 32
  • Just to add a comment here, this solution is accurate for patterns, but as @zeryth mentions below, `Simple` entity (possibly enhanced with phrase list) may be a better solution to your requirement. – billoverton Apr 22 '20 at 15:58