Can Alexa skill handler receive full user input? - echo

I want to develop an Alexa skill that is able to receive free text input from the user that doesn't necessarily map to an intent. Is this possible?

No, that is not possible. The closest thing is the 'literal' slot (input) type but that is now deprecated on the original USA region and was never supported on the other regions.

I have found that the custom slots return far more than the provided samples.

Related

IBM Watson Assistant: Remember previous intent?

Is it possible that the chatbot responds for example to node 7 taking into account an intent that was written in node 3?
Imagine that in the second question of the chatbot you say that you are a boy and then there is a jump to because there are equal questions for both genders, but then there is different information depending on having chosen a sex.
I don't want to ask that again. Then I want you to remember that attempt to decide.
With IBM Watson Assistant the dialog nodes typically react to conditions. The conditions are based on evaluating the current intent, entities or context variables. Context variables can hold a value or remember settings across the evaluation of multiple dialog steps (nodes).
In your case, you would gather information with questions and user answers, e.g. by utilizing slots. The chatbot would remember the gender, age group and more. The dialog nodes could switch to the specific question or reponse based on that context data or jump to a gender-specific subgroup of questions if needed.
I would recommend to look into some of the more complex samples (tutorials) and how the dialogs make use of context variables.

IBM Watson Assistant: How to train the chatbot to pick the right intent?

While developing and testing the conversation, IBM Watson Assistant identifies multiple intents and respond to the one with highest confidence level. Sometimes I want it to respond to second intent not the first one because it is more relevant to the current conversation context. For example, if the dialogue contains nodes to handle making transfer or payment, during the transfer scenario the user can say execute which will match both execute transfer and execute payment. So I want Watson to always respond to execute transfer which is the current context even if it identifies execute payment with higher confidence.
So users ask generic questions assuming that the bot is aware about the current context and will reply accordingly.
For example, assume that I'm developing a FAQ bot to answer inquires about 2 programs Loyalty and Saving. For simplicity I'll assume there are 4 intents
(Loyality-Define - which has examples related to what is the loyalty program)
(Loyality-Join - which has examples related to how to join loyalty program)
(Saving-Define - which has examples related to what is the saving program)
(Saving-Join - which has examples related to how to join saving program)
so users can start the conversation by utterance like "tell me about the loyalty program". then they will ask "how to join" (without mentioning the program assuming that the bot is aware). In that case Watson will identify 2 intents (Loyalty-Join, Saving-Join) and Saving-Join intent may have a higher confidence.
so I need to intercept the dialogue (may be be creating a parent node to check the context and based on that will filter-about the wrong intents).
I couldn't find a way to write code in the dialogue to check the context and modify the intents array so I want to ask about the best practice to do that.
You can't edit the intents object, so it makes what you want to do tricky but not impossible.
In your answer node, add a context variable like $topic. You fill this with a term that will denote the topic.
Then if the users question is not answered, you can check for the topic context and add that to a new context variable. This new variable is then picked up by the application layer to re-ask the question.
Example:
User: tell me about the loyalty program
WA-> Found #Loyality-Define
Set $topic to "loyalty"
Return answer.
User: how to join
WA-> No intent found.
$topic is not blank.
Set $reask to "$topic !! how to join"
APP-> $reask is set.
Ask question "loyalty !! how to join"
Clear $reask and $topic
WA-> Found #Loyalty-join
$topic set to "loyalty"
Return answer
Now in the last situation, if even with the loaded question it is not found, clearing the $topic stops it looping.
The other thing to be aware is that if a user changes topic you must either set the topic or clear it. To prevent it picking the old topics.
NOTE: The question was changed so it is technically a different question. Leaving previous answer below
You can use the intents[] object to analyse the returning the results.
So you can check the confidence difference between the first intent and second intent. If they fall inside a certain range, then you can take action.
Example condition:
intents[0] > 0.24 && intents.[1] - intents[0] > 0.05
This checks if two intents are within 5% of each other. The threshold of 0.24 is to ignore the second intent as it will likely fall below 0.2 which normally means the intent should not be actioned on.
You may want to play with this threshold.
Just to explain why you do this. Look at these two charts. The first one it's clear there is only one question asked. The second chart shows that the two intents are close together.
To take actual action, it's best to have a closed folder (condition = false). In that folder you look for matching intents[1]. This will lower the complexity within the dialog.
If you want something more complex, you can do k-means at the application layer. Then pass back the second intent at the application layer to have the dialog logic take action. There is an example here.
Watson Assistant Plus also does this automatically with the Disambiguation feature.
You can train Watson Assistant to respond accordingly. In the tool where you work on the skill click on the User conversations page in the navigation bar. In the message overview you would need to identify those that have been answered incorrectly and then specify the correct intent. Watson Assistant will pick that up, retrain and then hopefully answer correctly.
In addition, you could revisit how you define the intents. Are the examples like the real user messages? Could you provide more variations? What are the conflicts that make Watson Assistant pick the one, but not the other intent?
Added:
If you want Watson Assistant to "know" about the context, you could extract the current intent and store it as topic in a context variable. Then, if the "join" intent is detected, switch to the dialog node based on intent "join" and the specific topic. For that I would recommend to either have only one intent for "join program" or if really needed, put details about the specifics into the intent. Likely there is not much difference and you end up with just one intent.

Script to email form to user dependent on form info

Trying to create or edit a script that will tell google docs to send an e-mail containing form info to a specific individual if that individual's name is selected in the form.
any suggestions?
You can use Apps Script for that. There's a sample in the docs that shows how to send an email to a designated individual containing information captured by a Spreadsheet when a form is submitted:
https://developers.google.com/apps-script/guide_events#TriggerAttributes
I have a way to do this using only spreadsheet functions, no GAS required. It works well, and I use it all the time.
But I have bills to pay and I am not convinced people will pay money for "Send Email" type innovations. So the error checking is not that great and there is no documentation.
If you are interested, let me know,. But because of the low quality and lack of docs, it would probably take you 2 hours to get it up and running.
Eddy Parkinson
I'd strongly suggest you check out formMule, http://cloudlab.newvisions.org/scripts/formmule it can do exactly what you are asking, more info and a video http://youpd.org/formmule (note formmule was just recently updated so it looks slightly different then in the video.)
Good luck!

Determining credit/debit card type

I'm writing a POS application for the iPhone/iPod combination, using the same exact hardware used in Apple Stores:: EasyPay.
Ok, my hurdle is this: how do I identify which credit card type is being used as text is entered in the uitextfield?
I assume I've to use textField:shouldChangeCharactersInRange:replacementString:? However, I've got ideas floating around, but I simple cannot put them together to form code :/
Any help is appreciated!
Maybe I didn't uderstand your problem, but I think you can have a BIN's list (Bank Identification Number). For example, most credit card numbers beginning with '4' are Visa. If they begin with '5', they are probably Mastercard. This is only an example, you should have a complete list to identify each possible card. Unfortunately, a complete and updated list is paid, but you can have a good list searching for free information on the Web, like here.
You can make a reasonable stab at guessing the card type from the first six digits of the card number, which is known as the Issuer Identification Number (IIN)
The trouble is, you'll struggle to get a complete list of IINs. Even the major acquirers struggle to keep an up to date list, as issuers frequently add or remove ranges.
Luckily, the card type shouldnt generally matter. You should be able to perform basic validation of the length, and luhn check digit, then submit the card to the processor for validation and authorization.
You can contact Visa/MC and sign up for the BIN list updates. Visa is free but I believe MC has a fee. Once you sign up, you will get a cd mailed to you with the current BIN ranges monthly.
You can also go through a processor or ISO (independent sales org) if you are working with one. I assume since you have a payment app you have some sort of relationship with an ISO that sets ups merchant accounts for your customers. The ISO should be able to get the BIN list for you from the processor and probably for free.
I think you are on the right track with textField:shouldChangeCharactersInRange:replacementString:, as this gets called each time the user changes the content in the text field. It sounds like you do not actually want to change the textField, but instead want to change another, related control that identifies the card type. You can use the algorithm described in Determine Credit Card Type By Number as a helper function to adjust credit card type accordingly when the user begins typing.
You may want to skip the full verification until the input string has the correct number of characters.
Update: an interesting response in the same thread mentions that actually letting the user pick credit card type is a good idea because it at least shows the user the list of credit cards you accept.

I'm trying to program a unique app, and use voice command to trigger specific functions within the app

If anyone can help me with this, I'd be eternally in their debt.
Without getting bogged down in details, I'm trying to program an app so
that, for instance, while the application is currently launched, if I say the words,
"activate function A", a specific function which already exists in my app, is activated.
Have I explained myself clearly? In other words, on the screen of the phone is a button
which says "function A". When the software is "armed" and in listening mode, I want
the user to have the ability to simply say the words "activate function A",
(or any other phrase of my choice) and the screen option will be selected without requiring
the user to press the button with their hand, but rather, the option is selected/activated
via voice command.
My programmers and I have faced difficulties incorporating this new voice command capability,
even though it is obviously possible to do google searches with voice command, for instance.
Other voice command apps are currently in circulation, such as SMS dictation apps,
email writing apps, etc, so it is clearly possible to create voice command apps.
Does anyone know if this is possible, and if so, do you have advice on how to implement
this function?
QUESTION 2
Assuming that we are unable to activate function A via voice command, is it possible
to use voice command to cause the phone to place a call, and this call is received
by our server? The server then 'pings' the iPhone and instructs it to activate function A?
For this workaround to work, I would need the ability to determine the exact phrase.
In other words, the user can't be forced to use the word "call function A". I need the
ability to select the phrase which launches the function.
Hopefully I've been clear.
In other words, as a potential workaround to the obstacles we've been facing regarding
using voice command to activate a specific function within our app, is it possible
to harness the voice command capability already present in the phone? aka, to place
a phone call? And then this call is received by our server, and the server
accordingly pings the phone which placed the call, and instructs it to activate the function?
I obviously understand the necessity for the app to be currently launched, before it
would be possible for my application to receive the instruction from the server.
If someone can help me to solve this vexing problem, it is not hyperbole to say that
you would change my life!
Thanks so much in advance for any help one of you kind souls can provide!!!
Michael
I don't believe the iPhone comes with any built in speech recognition functions. Consider speaking to Nuance about buying and embedding one of their speech recognition engines. They have DragonDictate for iPhone, but they also provide a fair amount of other recognition engines that serve different functions. Embedded solutions is clearly one of their areas of expertise.
Your other path of pushing the audio to your server may be more involved than you expect. Typically this process involves end-pointing (when is speech present) and identification of basic characteristics so the raw stream doesn't need to be passed. Again, investigation into the speech recognition engine you intend to use may provide you with the data processing details you need. Passing continuous, raw voice from all phones to your servers is probably not going to be practical.