Entity not recognized - botframework

I trained my luis model to recognize an intent called "requestDefintion" with example utterances such as: "What does BLANK mean" or "Can you explain BLANK to me?".
It recognizes the intent correctly. I also added an entity called "topic" and trained it to recognize what topic the user is asking about.
The problem is that luis only recognizes the exact topic the user is asking about if I used that specific term in one of the utterances before.
Does this mean I have to train it with all the possible terms a user can ask about or is there some way to have it recognize it anyway?
For example when I ask "What does blockchain mean" it correctly identifies the entity (topic) as blockchain because the word blockchain is in the utterance. But if I ask the same version of the question about another topic such as "what does mining mean", it doesn't recognize that as the entity.
What is the best way to go about this?

Does this mean I have to train it with all the possible terms a user can ask about or is there some way to have it recognize it anyway?
You can try to use phrase list features, which can help LUIS recognize intents and entities. For example, you can create a phrase list named " topic" that contains the values BLANK, blockchain and mining etc.
My test with utterance what does mining mean:
Using phrase list, the score is 0.94
Not using phrase list, the score is 0.77
Note: If define too many intents, it becomes harder for LUIS to classify utterances correctly, please do not define too many intents.

Related

Handling typos / misspellings on list entities

What is the best practice approach to handle typos / misspelling on LUIS List Entities?
I have intents on LUIS which use a list entity (specifically Company Department - HR, Finance, etc). It is common for users to misspell this when putting forward their utterance. LUIS expects an exact match, it doesn't do a "smart" match, and therefore doesn't pick up the misspelled entity.
a) Using bing spell check is not necessarily a good solution. e.g. Certain departments are acronyms such as VRPA - and bing wont correct a typo there.
b) When I used LUIS a year ago, I would pre-process the utterance and use a Levenshtein distance algorithm to fix typos on list entities before feeding them to LUIS.
I would imagine that by now LUIS has some better out of the box way of handling this very common use case.
I'd appreciate input on what the best practice approach is to handle this.
#acambitsis and I exchanged messages via his UserVoice ticket, but I'm going to post the answer here for others.
A combination of Bing and Simple Entities might be what you're looking for, then (they're machine-learned).
I was able to accomplish something close and attached images.
In entities, I created a Simple entity with the role, VRPA. In intents, I created the Show Me intent and added sample utterances "Show me the VRPA" and "Show me the VPRA". I clicked on V**A and selected the Simple Entity:VRPA role. After training, I tried "show me the varp" and it correctly guessed "varp" was the "Simple:VRPA" entity.
You may also find RegEx entities useful. For acronyms, you could do something like: /[vrpa]/i and then any combination of VRPA/VPRA/VARP/ARVP would match.
I highly recommend reading through the Entity Types and Improve App Performance to see if anything jumps out to solve your particular issues.
This may not do exactly what you're looking for. If not, I'd recommend implementing a fuzzy-matching algo of your choice.
entities
intents

How does the "The values are interchangable" option in Phrase List work in LUIS?

I've gone through the ocumentation and tried understanding the Phrase List feature. Although I'm sure of the purpose of the Phrase List feature, I couldn't quite get the purpose of the "interchangable" option intutively.
Any thorough explanation would be appreciated.
#Srichakradhar at your suggestion, posting answer related to your question on gitter to here on StackOverflow as well to benefit the community as a whole!:
"...regarding your question on phrase lists, happy to speak high-levelly on what the feature does :)
#srichakradhar
So ultimately the goal with LUIS is to understand the meaning of the user’s input (utterance), and through calculations, it returns to you the value of how confident it is about the meaning of the input. Using phrase lists is one of the ways to improve the accuracy of determining the meaning of the user’s utterance
—more specifically, when adding features to a phrase list, it can put more weight on the score of an intent or entity.
Using a couple of examples to illustrate the high-level concept of how features help determine intent/entity score, and in turn predict the user’s utterance’s meaning:
For example, if I wanted to describe a class called Tablet, features I could use to describe it could include screen, size, battery, color, etc. If an utterance mentions any of the features, it’ll add points/weight to the score of predicting that the utterance’s meaning is describing Tablet. However, features that would be good to include in a phrase list are words that are maybe foreign, proprietary, or perhaps just rare. For example, maybe I would add, “SurfacePro”, “iPad”, or “Wugz” (a made-up tablet brand) to the phrase list of Tablet. Then if a user’s utterance includes “Wugz”, more points/weight would be put onto predicting that Tablet is the right entity to an utterance.
Or maybe the intent is Book.Flight and features include “Book”, “Flight”, “Cairo”, “Seattle”, etc. And the utterance is “Book me a flight to Cairo”, points/weight towards the score of Book.Flight intent would be added for “Book”, “flight”, “Cairo”.
Now, regarding interchangeable vs. non-interchangeable phrase lists.
Maybe I had a Cities phrase list that included “Seattle”, “Cairo”, “L.A.”, etc. I would make sure that the phrase list is non-interchangeable, because it would indicate that yes “Seattle” and “Cairo” are somehow similar to one-another, however they are not synonyms—I can’t use them interchangeably or rather one in place of the other. (“book flight to Cairo” is different from “book flight to Seattle”)
But if I had a phrase list of Coffee that included features “Coffee”, “Starbucks”, “Joe”, and marked the list as interchangeable, I’m specifying that the features in the list are interchangeable. (“I’d like a cup of coffee” means the same as “I’d like a cup of Joe”)
For more on Phrase Lists - Phrase List features in LUIS
For more on improving prediction - Tutorial: Add phrase list to improve predictions"
Taken from documentation (here):
A phrase list may be interchangeable or non-interchangeable. An
interchangeable phrase list is for values that are synonyms, and a
non-interchangeable phrase list is intended for values that aren't
synonyms but are similar in another way.
There is also a great reply here on MSDN:
Choose "Exchangeable" when the list of words or phases in your feature
form a class or group -- for example, months like "January",
"February", "March"; or names like "John", "Mary", "Frank". These
features are "exchangeable" in the sense that an utterance where one
word/phrase appears would be labeled similarly if the word/phrase were
exchanged with another. For example, if "show the calendar for January" has the same intent as "show the calendar for February", this
suggests choosing "exchangeable".
Choose "Not exchangeable" for words/phrases that are useful in your
domain, but which do not form a class or group. For example, the
words "calendar", "email", "show", and "send" might be relevant to
your domain, but might all be associated with different intents, like
"show my calendar" or "send an email".
If you're not sure, you can try either and see if there's any
difference in performance.

LUIS entity not recognised

I trained my luis model to recognize an intent called "getDefinition" with example utterances such as: "What does BLANK mean" or "Can you explain BLANK to me?". It recognizes the intent correctly. I also added an entity called "topic" and trained it to recognize what topic the user is asking about. The problem is that luis only recognizes the exact topic the user is asking about if I used that specific term in one of the utterances before.
Does this mean I have to train it with all the possible terms a user can ask about or is there some way to have it recognize it anyway?
For example when I ask "What does blockchain mean" it correctly identifies the entity (topic) as blockchain because the word blockchain is in the utterance. But if I ask the same version of the question about another topic such as "what does mining mean", it doesn't recognize that as the entity.
Using a list or phrase list doesn't seem to be solving the problem. I want to eventually have thousands of topics the bot responds to, entering each topic in a list is tedious and inconvenient. Is there a way LUIS can recognize that its a topic just from the context?
What is the best way to go about this?
Same Doubt, Bit Modified. Sorry for Reposting this here.
At the moment LUIS cannot extract an entity just based on the the intent. Phrase lists will help LUIS extract tokens that don't have explicit training data. For example training LUIS with the utterance "What does blockchain mean?" does not mean that it will extract "mining" from "What does mining mean?" unless "mining" was either included in a phrase list, or a list entity. In addition to what Nicolas R said about tagging different values, another thing to consider is that using words not commonly found (or found at all) in the corpuses that LUIS uses for each culture will likely result in LUIS not extracting the words without assistance (either via Phrase list or list entity).
For example, if you created a LUIS application that dealt with units of measurement, while you might not be required to train it with units such as inch, meter, kilometer or ounce; you would probably have to train it with words like milliradian, parsec, and even other cultural spellings like kilometre. Otherwise these words would most likely not be extracted by LUIS. If a user provided the tokens "Planck unit", LUIS might provide a faulty extraction where it returns "unit" as the measurement entity instead of "Planck unit".

MSBOT-LUIS: How to specify the mandatory words in utterance? Is it possible by using phrase list features?

I am using phrase list features of LUIS. i am adding my mandatory words in my phrase list.(correct me if i am wrong)
For single mandatory word my intent works fine. But in my another intent i have 2 mandatory words in single intent which is not working fine.
Behaviour
My phrase list- product: [moisturizer,anti wrinkle cream,laugh lines,anti aging skin treatment]
target area: [face,my face,neck,forehead]
Intent name- ste1
utterance- do you have moisturizer?
user enters- "do you have bla bla"- as expected its going to none intent.
Intent name- ste2
utterance- do you have moisturizer for my face?
user input- "do you have moisturizer for my bla bla"- As here "moisturizer" is present bt "my face" is not! This should also hit none intent but its hitting to ste1 intent because "do you have moisturizer?" is completely present in ste1.
Expected Result-
I want to validate that my these two words(moisturizer, face) should be mandate to hit the ste2 intent otherwise i want it to hit none intent.
LUIS only provides a recognition service. If you want to validate something like "face" and "moisturizer" being present in a user's utterance, this should be done in your code.
You may train your bot to direct "incomplete" utterances to the "None" intent (by your description, utterances like, "I want moisturizer", or "I want lotion") but as you yourself noted;
But user can enter any random thing so I cant predict what should be in none intent...
Therefore what you should do in your model and code is add entities for "moisturizer" and "face". With these entities, inside of your code you can take the LUIS response and quickly see if you have the required basic information to start the dialog. If one entity is provided ("moisturizer") but another entity is missing (a part of the body), your bot would help the user disambiguate by prompting them what they're looking for specifically, e.g. face moisturizer or hand moisturizer.
A good way to approach the phrase lists and pattern features is that they're augmentations; they do help the machine learned model, but the weight/impact they provide when determining an intent is less than an entity's weight. The phrase lists and pattern features are not replacements for entities.

LUIS- Doesn't not understand Intent sometime

We are developing Library BOT using Microsoft BOT.
Here We have created one Intent BookSearch, and Entity BookName, BookAuthor.
We trained LUIS with Simple question,but he works only matching questions.
Ex. I trained LUIS like "I need book", so its works properly
But with Same question we write "I need a book", its doesn't understand to match with book intent.
Can anyone help us here? Like that so many scenario where we found LUIS only works with exact matching questions.
One More Problem, We have Book name, with Three Work, unable to tag three words as a bookname entity.
It sounds like your model just needs more training with a variety of sentence structures.
LUIS will match the exact intent when it's been trained but needs more examples to get better with novel utterances. So "I need book" vs "I need a book" should be pretty easy for it to learn with more properly labeled utterances.
As for the title with three words, highlighting them all by clicking and dragging across all three is possible.
You have to write more possible questions which user can ask regarding book?
Let me give an example to explain this...
I need book
I need a book
What latest book you have?
Can you recommend a book to me
I am looking for book
I am looking for a book
In above examples - Intent should be - FindBook
I am looking for C# book?
In above example - Intent should be - FindBook, here user has mentioned the Subject (C#) as well. Subject will be entity.
I am looking for C# book written by Joseph Albahari, Ben Albahari
In above example - Intent Should be one - FindBook, here user has mentioned the Subject and Writer.
Subject and Writer will be entity.
You have to train your model and feed more possible questions, then only LUIS will work perfectly.
You can highlight full sentence as well.

Resources