I have an intent named: "Smalltalk.greetings.how_are_you"
When I run a Luis query, the json responses gives "Smalltalk_greetings_how_are_you"
Why so ?
If this intended please refer to the documentation explaining why and to use special characters as intent name because I really need to do so.
The closest thing to documentation on this is found here. However, it doesn't specifically mention periods.
I'll file a bug report/feature request to add some documentation on this.
My guess is that LUIS replaces all separator characters with underscores for consistency. There may be some trouble parsing some due to the various ways the JSON gets serialized and deserialized.
That being said, as you're now aware of the behavior, I'd either account for it in your code or change your intent names in LUIS. If you're worried about this happening with other intent names, you could use RegEx matching in your code when you look for intents.
I know, not ideal, but the only part of this that's likely to change is updated documentation, which I'll put a request in for.
Related
Here is a pattern i've created
({SeminarsList}|seminar)[s]((list|lists)|(info|information))[(?|.|!)]
I would expect the optional [s] to work for both entity list and the word i.e. ending with s on seminars such as seminar vs seminars. However, only the entity list works as expected. the s for seminars is ignore and the pattern isn't recognized for seminars info
Is this a bug or something expected. I would rather it work like the entity list as that makes perfect sense and is the same way reflected in the documentation?
update
Also, the word on it's own without being a group works as expected.
so for example this works
where[(are|is)][the](SeminarsList|seminar)[[']s][seminar][[']s] [(location|locate|located)]
i.e. the send seminar with optional punctuation works as expected just not in a grouping
Update**
Here is an example from the documentation
Select the OrgChart-Manager intent, then enter the following template utterances:
Template utterances
Who is {Employee} the subordinate of[?]
Who does {Employee} report to[?]
Who is {Employee}['s] manager[?]
Who does {Employee} directly report to[?]
Who is {Employee}['s] supervisor[?]
Who is the boss of {Employee}[?]
In the above example this is the documentation of how this works. Including adding "punctuation" to the end of the sentence in an optional format. If one would expect this to work I would also expect the other methodology of working too.
Per the docs (emphasis mine):
Pattern syntax is a template for an utterance. The template should contain words and entities you want to match as well as words and punctuation you want to ignore. It is not a regular expression.
So, the pattern syntax is not meant to be used for single letters, but for full words. It has to due with the tokenization of utterances.
If you'd like this feature added, I'd recommend upvoting this LUIS UserVoice ticket.
I am using Microsoft Bot Framework to develop chatbot and my questions is that how can I handle incorrect responses from a user.
Suppose bot asks for name of user and he or she replies "don't know".
I have seen in boiler plate code of bot framework that it handles minimum length validation, but how can I handle this logical checking.
Thanks in advance.
I am assuming you are using the v4 C# SDK, let me know if this is not correct and I can update my answer for node or v3 for you.
This Sample Does exactly what you are trying to do It has a validator that checks the length of the user's input and reprompts if the length is too short. You can see this in this method
In general name validation is fairly difficult because names can be very diverse and contain special characters like "-", "'", and others. Using a prompt with a custom validator should give you the opportunity to at least add some validation like length and numerical character checking.
An expected answer normally has a known format. If bot is asking a name then the name would not have numbers and special characters.. You can do a quick check if the words returned by user are part of standard english words (there are plenty libraries having this list of words). You can even pass the returned sentence to LUIS and see if you get a known intent, and then you can disqualify the answer.
Lets suppose it is movie bot. I added entity MovieName, and phrase list containing movies. One of the movie name is "Star Wars", and if user misspell it to "Stra Wra" then how I can tackle this issue? Will Bing spell check service help for non English movie names, I'm not sure?
LUIS will not be able to capture misspelled entities by itself unless you provide examples with misspelled entities which is not practical.
So you need to feed the utterances corrected to LUIS.
For Bing spelling correction service you have to try it yourself, but I guess it will handle your case.
If you expect some common misspellings that you expect to be repeated, you could add them in an exchangeable phrase list feature. That will help with the prediction of these misspelled entities.
There are multiple ways to solve this:
Use synonyms with most common mistakes
Have another step in your pipeline (before going to LUIS), which matches user input to possible options and corrects them (even a self made solution would do great, but you can also try to add ElasticSearch with fuzzy queries)
I am playing around with the Luis stock ticker example here, GitHub MicrosoftBotBuilder Example, it works well and the entity in the utterances is identified but there are stock tickers in the world that have periods in them such as bt.a
Luis by default pre-processes utterances where word breaks are inserted around punctuation characters and therefore an utterance of "what is price of bt.a" becomes "what is price of bt. a" and therefore Luis thinks the entity is "bt" instead of "bt.a"
Does anyone know how to get around this? Thx
This is how LUIS tokenizes utterances and I don't think it'll change int he near future.
I think you can investigate one of the 2 solutions:
Preprocess the utterance and normalize entities with punctuation (maybe save them in a map), and reverse the process when LUIS is called and the entities have been extracted.
Use phrase list features and add the entities that LUIS misses in their Tokenized form, label the entity tokens in the utterance, and retrain the model (I suggest you try that in a clone of your app, so you don't lose any current progress)
I need to process sentences with website addresses in them so I had to deal with a few different symbols. I found a technique that works for me, but it is not very elegant.
I am assuming here that you have an entity setup to represent the "stock symbol"
Here is what this would look like in your case.
Detect the cases when LUIS gets the "stock symbol" entity wrong. In
your case this may be whenever it ends in a period.
When LUIS gets the entity wrong, tokenize the raw query using spaces
as the separator. Grab the proper token by looking for a match with
the wrong partial token.
So for your example....
"what is price of bt.a"
You would see the "stock symbol" entity of "bt." and know that it is wrong because it ends in a period. You would then tokenize the query and look for tokens that contain "bt.". This would identify "bt.a" as the requested symbol.
Its not pretty, but in the case of website addresses has been reliable.
Can anyone provide some insight on the required syntax to use to search LOINC using FHIR for a specific string in the labs descriptive text portion of an Observation resource?
Is this even possible?
The documentation is all over the place and I can't find an example for this generic kind of search.
I found similar examples here: https://www.hl7.org/fhir/2015Sep/valueset-operations.html
Such as: GET "[base]/ValueSet/23/$validate-code?system=http://loinc.org&code=1963-8&display=test"
But none of them are providing a general enough case to do a global search of the LOINC system for a specific string in an Observation resource.
None of my attempts to use the FHIR UI here, http://polaris.i3l.gatech.edu:8080/gt-fhir-webapp/search?serverId=gatechreadonly&resource=Observation , have been successful. I keep getting a 500 Internal Server Error because I don't know the correct syntax to use for the value part of the search, and I can't find any documentation out of all the copious documents online that explains this very simple concept.
Can anyone provide some insight?
Totally frustrated at this point.
Observation?code=12345-6
or
Observation?code=http://loinc.org|12345-6
where 12345-6 is whatever LOINC code you want to look for (e.g. 39802-4)
The second ensures you'll only match on LOINC codes as opposed to codes from other systems, though given the relatively unique format of LOINC codes, you're mostly safe without including that.
If you want to search for a set of codes, then you can separate the codes or the tuples with commas: E.g.
Observation?code=12345-6,12345-7
or
Observation?code=http://loinc.org|12345-6,http://loinc.org|123456
If you expect to search by a really long list of codes frequently, you can define a value set that includes all the desired codes and then filter by value set:
Observation?code:in=http://somwhere.org/whatever/ValueSet/123
Note: for readability, I haven't escaped the URL contents, but you'll need to escape the URL values appropriately.