Im tring to create a booking system for a restaurant so the assistant go to ask to user number of guest, time and day to reserve, and finally the name and the phone number of guest! But many time the phonenumber is confused by the guest number.
I set in parameters for #guest the value of #sys.number and for $telephone the entity of #sys.phone-number, but sometimes get wrong recognize. I could make it work?
The Dialogflow team has a really full-featured example on Github here (it's a bike shop, rather than a restaurant, but most of the functionality is the same). Give it a look for some inspiration.
Regarding the specifics of recognizing phone numbers: I'd recommend adding a bunch (like more than 10) of example training phrases to the appropriate Intent that include phone numbers. Often the problem with matching these things is just a matter of the number of examples the system gets to learn from.
Good luck!
Related
I have a composer text input task with the following settings. I'm making a bot testing the capabilities of Luis integrations with a bot. The issue I'm facing is not the entity recognition itself; rather the entity validation on the input task for the entity. I only notice this when using a text input task and have the entity validation working for other tasks (specifically datetime).
Current Entity User Input Task
To illustrate my issue, here are two current behaviors of the bot:
WAI: I say something like "I want to make an appointment and my contact number is (800)-234-5678". This not only triggers my intent model and skips the user input question where I ask for the user's phone number (seeing as they provided one already) and the conversation.phoneNumber variable is (800)-234-5678
Not WAI: I say something like "I want to make an appointment and my contact number is abc". This triggers my intent model as desired but skips the user input question where I ask for the user's phone number (because it thinks they provided one already) and the conversation.phoneNumber variable is abc. Ideally, this is where I would think validation would happen and it would ask the question "What is a good phone number for our office..." seeing as abc isn't a phone number.
For reference, this is the documentation I'm following:
https://learn.microsoft.com/en-us/composer/how-to-define-advanced-intents-entities
I considered a regex validator as an option because phone number is such a trivial entity that can be easily defined, but something more complex/diverse (such as geographic location, currency, etc) would be better handled by whatever dictionaries Microsoft has in place for built-in entities. I can see the raw data when I type in an utterance that shows no entity is being picked up (so SOMETHING is working in the background). I'm just curious if I can make use of that functionality in a bot composer task.
As I said before, this is working fine when validating if a user entered a date/time on a separate task; I'm hoping there's a feature for this for other built-in, text-based entities in the bot composer.
I assume that whatever built-in entity recognition that Microsoft has for their built-in entities here https://learn.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-entities is vastly superior to whatever regex I can come up with, and some type of built-in validation would be handy for more complex bots.
Not able to identify simple phrases like "my name is not Harry, it's Sam".
It is giving me name as harry and company name as Sam, Since name and company name was required in the same sentence.
It should have taken name as Sam and prompted the user again for company name OR should have given complete fallback.
Hi and welcome to Stackoverflow.
Dude. This is not a simple phrase.
Negative questions are always very difficult to catch by Dialogflow.
Suppose I have a question like,
I want to check *google* revenue for the year *2017*
As you can see, google and 2017 are the entities.
But now in the same way if you say,
I don't want to check *google* revenue for the year *2017*
The chances of hitting that old intent is very high as dialogflow matches almost 90% of this sentence with your old sentence. So it might fail.
Hope you are trying to ask something similar to this.
Anyhow coming to your point, If company name and name are different entities, then
Two things you can avoid:
As everyone mentioned,check your entities. The values should not be present in both the entities. This will fail because dialogflow will not know whether it should treat 'Sam' as your name or company name.
If you are not using the values from an entity, instead using '$ANY', then It has a very high chance of failing. And If you are using Dialogflow's system entity like, $given-name, then that is also not preferred as it does not catch all the names. So avoid these entities.
Things you can try:
Train Train And Train. As you would be aware, the training section in dialogflow is pretty good. Train it a few times and it will automatically learn and master it.
But , please note: Wrong training will result in wrong results. It should be 100% accurate. Always check before you approve a training.
And try using webHooks, actions, and/or events to figuring your way out from an external API.
I've defined a custom slot types in the Amazon Developer console, the slot contains a list of names, as below.
homer simpson
ned flanders
principal skinner
comic book guy
I've then defined the sample utterances as below.
PlayAudio to play {Name}
So in the end, I want the user to be able to say something similar to the folliowing:
Alexa, ask the simpsons to play homer simpson
Alexa, ask the simpsons to play ned flanders
Alexa, ask the simpsons to play principal skinner
Alexa, ask the simpsons to play comic book guy
Of course, there is an extremely high chance that Alexa will hear the name incorrectly, so I need to be able to match the name that is heard as closely as possible one of the slot values.
How would I go about doing this, would I have to code it in the function or is there a better way?
When using custom slots, there is a chance that Alexa will provide a value not in the list. This gets specially problematic as the list grows in size. Using the beta testing functionality as Tom suggested can help but you won't be able to catch all the issues and eventually this will not scale.
I found out that the only way to completely ensure you are getting a value from your list is to have the full list in the skill and check against it every time. In order to check, exact matching is not always the best option and I've tried two approaches:
String Edit Distance functions: work well when a used may say incomplete utterances or add words to the utterances in your list. Check: https://en.wikipedia.org/wiki/Edit_distance
Acoustic/Phonetic: relatively easy to implement may work better for identifying foreign words or proper names. You can preprocess your list for quick comparisons. Check: https://en.wikipedia.org/wiki/Soundex
You are right that there is a high chance 'that Alexa will hear the name incorrectly'. My solution is to do a bunch of trial and error with human testers to discover what the common mis-interpretations are, and then hard-code fixes for those.
So I get a tester to say the different names and make a record of what they said. I then look at what Alexa gives me as the slot value, and where there are discrepencies I add a hard-coded substitution to my skill.
Is there an effective Natural Language Processor that can fetch the phone number and date of birth from human speech. Each user has a different way of specifying the phone number and date of birth. Hence, converting speech to text and then parsing the text for phone number is not helpful.
You can use Google speech to text api. I had used same for entering account number for blind people. I was working for bank so I there were lots of numbers involved as input eg account number, card number etc.
With Google STT engine you can define custom voice inputs.
Also I had created feedback mechanism using Text to Speech Api so that app can tell if users feedback is invalid and request him to speak again.
You can see code snippet at github.
https://github.com/hiteshsahu/Android-TTS-STT
Easiest way is to extract text from speech, there is plenty of tools, proprietary (nuance), and tinker friendly open source like sphinx, and plenty of tools to extract dates and phones expressed differently. IBM Watson offers one, Smart Formatting beta, to uniform dates and phones in own transcripts. To guess which dates are birthdays you try detect related keywords (birth, born so on) nearby.
For few free alternatives, check
For phone #
https://www.npmjs.com/package/phone-number-extractor
https://github.com/googlei18n/libphonenumber
For date extractions check prev questions
Extracting dates from text in Java
Best way to identify and extract dates from text Python?
There is a patent for the process your are asking, but you might have to pay royalties or smth.
http://www.freepatentsonline.com/8416928.html
If you want to fetch the phone number and date of birth from human speech.
So, you can use another option and implement it.
https://cloud.google.com/speech/
This API is really useful for converting your speech to text. I also have this problem at one moment so you can try it too.
The another API which is really good for authentication.
https://api.ai/
I hope it helps you.
I was wondering if it is possible to create a address book or contacts app, like Apple's, that uses Core Data and an SQLite storage file.
The part I am not sure if it is possible, or how to do it is having multiple properties for phones. So a user could input five different phone numbers for the same contact.
The only way I could think of doing it is say... have one entity for the person... then another entity for phones with them having a relationship. So one person could have multiple phones but one phone could only have one person. But that didn't seem to like it would be a good way to do it... anyone have a suggestion?
I don't see how you came to the conclusion that several entities are not a good way to do something like this. That's the only way to do it if you want flexibility. Adding three phone number attributes to your entity is definitely the wrong way.
I would use a simple data model like this:
Each record has a type (e.g. email, phone, fax, IM contact) a key (e.g. office, home, mobile, twitter, jabber) and a value (e.g. 55512345, foo#bar.com, #foobar).
Such a model offers the most flexibility and it's not very complicated to implement.
Though you need a couple of predicates to get phone numbers, emails etc.