DialogFlow doesn't recognize numbers two an four - dialogflow-es

Using the telephony integration in DialogFlow, when trying to capture an intent like (for example)
I'm looking for the number six
Where six is defined as #sys.cardinal or #sys.number
I would get it to recognize any single digit except 2 & 4.
For those the text would almost consistently read as "to" & "for" respectively.
This would happen both on the phone, and when testing on the Dialogflow console, pressing the little microphone icon and recording the input.
Why is it missing these numbers when it knows I'm expecting a number in that position?
What can I do to give it better hints?

If the exact phrase the user speaks is "I'm looking for the number two" I believe the agent will detect is as a number based on the context of the phrase.
If they just say "two" it may detect as "to" instead.
Will users only be able to provide a single digit here? If so, perhaps you can create an example for every number (given there are only 10 digits that wouldn't be too onerous).
However, if you're expecting the user to provide a string of numbers perhaps try a different data type for the parameter. The number-sequence type might be more suitable.

Related

Can I extract a parameter based on a terms position in a question?

I would like to perform an action based on a user specific number extracted from a text request: "Open contract number XYZ". Where 'XYZ' is the parameter value I need. There are no obvious boundaries for the content of XYZ. It could be a true number or it could be a string. Can an entity type be based on the term position within the request? I expect dialogflow can match the intent based on the first part of the phrase: "Open contract number". How can I get the parameter value that follows that phrase?
In theory, yes. For this particular use case, you can use the #sys.any system entity. Just make sure to add many training phrases that can help your agent to detect it.
For example:
Make sure to mark the contract numer (or id) in the training phrases, so it can be correctly detected as a parameter.
Now, you can use the value detected in your responses
Example of a detected intent
Keep in mind, that the use of any is not ideal (can lead to unintended behavior); however, if you add a good amount of training phrases and you use contexts to handle the conversation flow, it should work fine.
An additional suggestion. If there's any recognizable pattern in the contract id, you can use regexp entities instead of #sys.any, which will also increase the accuracy.

what is the best way to have a bixby capsule collect a phone number?

What is the best way to collect a phone number? I struggled with this a few months ago, so maybe some things have been updated since then. I ended up creating a collect phone number action that would convert 10 concepts (one for each phone digit) to a string and then send that in an api call. I did not see a library capsule that took care of this but whether library capsule or not, is there a better way to collect a phone number? hopefully this question saves a lot of people the trouble of defining 10 concepts!
You would not need a separate concept per digit; a text primitive concept that holds a full number is all you would need.
Additionally, using an input-view to show the user a form requesting their phone number would be the best method of implementing your use case.
This input-view form can be additionally modified with a mask attribute to ensure that invalid entries are checked as the user enters them. You can learn more about how to further customize your mask attribute here in our documentation.
For example, the following code snippet would only allow a phone number with the pattern (100) 000-0000.
text-input {
id (pnumber)
type (PhoneNumber)
label (Phone Number)
pattern {
mask ("(100) 000-0000")
}
value ("#{raw(this.phoneNumber)}")
}

Dialogflow intent issues or bug

Okay, I am trying to figure out why dialog flow keeps adding dashes or extra numbers when I call my bot and the telephony. I can say 6 digit number and it either adds a dash of an extra number. I have used all the sys entities and a custom entity and it does this every time. It acts as if it wants a phone number. Is there a fix? And yes I have added definitions of how numbers I want back. The number I was asking for is 813637 but it adds numbers and/or dashes. I can add the screenshot to this to show you what I get back
Thanks
As per the Google documentation: https://dialogflow.com/docs/reference/system-entities
The description of #sys.number says the input is represented as Ordinal and Cardinal numbers.
However, as per my understanding you require it to be a Nominal Number. Also in your case i understand it is a sequence of numbers. In which case you should try using #sys.number-sequence.
Hope this works for you.
Do let us know how it goes in the comments.

Dialogflow Entity Match Issues

We built an intent to detect user's last four digits of social security numbers. The training phrases capture #sys.number-sequence and #sys.number entities. We match the intent using voice (audio). When the digits are read out separately, #sys.number-sequence is matched. When we say forty five sixty seven (4567) or four thousand five hundred and sixty seven (4567), #sys.number is match. This works fine for most of the numbers. But we ran into the following two issues:
When we read "one one one one", none of the two entities is matched. The voice is actually transcribed as "one one one one". But it is not matched to a number sequence of 1111.
When we say "eighty two seventy five", #sys.number is matched, but only 82 is captured. The parameter value is 82 as opposed to 8275.
Appreciate it if someone could shed some light on these issues.
Well this could also be the issue of Speech to Text engine that you are using. But to check the Dialogflow, I built following Entity and Intent and I was able to capture 4 digits easily. I tested using Dialogflow's Mic option for voice commands.
Also, check out the other systems entities that you may use to capture numbers even though they are designed for something else like zipcode.
Hope the following example helps.
Entity
Intent

Google DialogFlow (API.AI) - Slot Filling answers only fire 2 times, then exit, and do not cycle through phrases

I have an intent with a simple slot filling question, which gathers a Number-Sequence of 4 characters long.
It looks like this:
The problems are as follows:
There are 3 different phrases defined under the slot filling list. (3rd image above). However, only the first one is prompted twice in a row by the system.
After the phrase is prompted twice, the system exits. I expect it to keep prompting the 3 different phrases round-robin style, until the user gets it right.
Is the maximum number of attempts specified somewhere? Can it be changed?
Can we make it use all of the slot-filling phrases, instead of just the first one?
First thing, if you say your verification code is 4-digit long, you should train your agent for 4-digit code only, I can see it in the first snap that you've trained it for 1-digit code only.
Anyways, now coming to your first question, The number of prompts that you have defined here are variations of each other. Api.ai will randomly select any one of them & send it as a response to the user. You do not have a choice to tell the system which one to be prompted first & which one to be second one neither you can define the cycle of prompts like round-robin.
Now, Answer to your second question, I have tried the same set-up at my end. It keeps on prompting unless & until it receives the correct code. Please check snaps. so, there is no limitation to the number of attempts you can have.

Resources