In order to drive an App conversation in a purposeful direction, the user can be prompted to select from a number of Smart Suggestions.
Smart Suggestions have multiple purposes:
- To help users make common questions and requests;
- To guide users through a workflow;
- To give the user ideas for potentially useful questions and requests;
- To help new users use the system;
- To prepare the App for potential future next steps in a workflow.
Smart Suggestions appear graphically at the bottom of the conversation as UI elements called ‘Chips’. When the user touches a Chip, the App will type the message as if the user had typed it themselves.
How to create Smart Suggestions
Smart Suggestions are directly linked with Intents. It’s perhaps helpful to imagine an Intent as a container that holds multiple Smart Suggestions.
The code block below shows how to add Smart Suggestions to an Intent:
Once an Intent is added to an App and used, the system will start learning and the Smart Suggestions will start appearing.
Conditional Text
The text of a Smart Suggestion can vary depending on the conditions in the state object. For example, a Smart Suggestion could address a user by their name if they have previously entered it – so instead of just saying "Hello", the suggestion could be "Hello 'person'":
The closure personCondition returns ‘true’ or ‘false’ depending on whether a selected person is stored within the state object. If there is one, the suggestion will be "Hello 'person'"; if not, it will display the default "Hello".
Suggestion matching
To match the Smart Suggestion, there is a method within the Intent class called matchSuggestions:
This method will evaluate if the message sent by the user matches any of the Smart Suggestions within the Intent. It returns ‘true’ if it matches and ‘false’ if it doesn't.
Overriding the Prediction
The developers can override the Machine Learning logic the App uses to predict the next intent if they want to control exactly which Smart Suggestions will be shown to the user. This is done by implementing the closure onPrediction for a given intent:
Following the Intent Prediction Process, the system at the end of the Intent Execution Hierarchy processes all the available onPrediction closures.
The Machine Learning determines the probability of each intent happening next. If there is an onPrediction closure for a given intent, the ML ignores its own calculations and replaces that probability with the one calculated by the closure.
In the example above, the developer is specifying that if the current intent finalising the process is either q1 or q3, the probability of q2 happening next is 100%. If the current intent is q4 or q5, then the probability is 80%. The probability of q2 happening next is 0% for any other intents.
Comments
0 comments
Please sign in to leave a comment.