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.
Related
I am working on text normalization. I have descriptions of variables/attributes, which I need to convert to correct english.
A an example is shown below:
"This is the sta of the customer's order"
The word 'sta' above needs to be converted to 'status' based on the error and the context.
I tried out a character level encoder decoder architecture, but did not get good results.I need some direction on how to approach this problem.
input :"This is the sta of the customer's order"
output: "This is the status of the customer's order"
This is called spell checking. There are ways to do so, one common way is to use minimum edit distance. An edit is one of these actions : adding a char, removing a char, replacing a char with another, transposing two adjacent chars. You can use edits to make new words out of mistaken words, and use a dictionary to see if the word really exists in English language. There may be more than 1 candidate for each incorrect word to choose from. There are also ways for candidate ranking.
Reading this paper may be a good start :
A Survey of Spelling Error Detection and Correction Techniques
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)}")
}
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.
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
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.