A few weeks ago, we introduced a new Alexa development feature called Entity Resolution. In short, Entity Resolution allows Alexa developers to define synonyms for their slot values, so that the Alexa service can parse those values instead of having to write that logic on their own. Today, we have made Entity Resolution even easier to use by adding the ability to manipulate these synonyms and IDs via our Skill Builder user interface.
In Skill Builder, we can create new slot types to be used by our intents and utterances. For this example, we are creating a new slot named “Characters.”
Example above shows a new slot type being created, with a name of “Characters.”
Once you create a slot, you need to provide a list of relevant slot values that represent the words a user might use in their utterances. In this example, if our sample utterance was similar to the one below, we might expect a user to mention a specific character’s name.
Tell me more about {Character}
To do this with our slot, we can provide a list of expected character names that a user might say as our slot values.
Example above shows a list of slot values for our Character slot.
You can then define the ID field, which is a unique identifier that you can use to consistently determine which slot value was selected.
Example above shows ID values added to each of our slot values.
Finally, you can add synonyms to your slot values. In this example, we have created synonyms for each of our character values rather than creating separate slot values for each of these additional terms. This allows the Alexa service to parse and resolve these examples back to a consistent slot value, rather than requiring your service to make those determinations.
Example above shows a list of synonyms for each of our slot values.
Once we have created each of our slot values, you can also see this data reflected in the Skill Builder code view as well. You can add your changes in either place, so use the tool that is most convenient for you.
ID and synonyms are the new values that we create for Entity Resolution. (see Define Synonyms and IDs for Slot Type Values) When a user interacts with our intent using this slot, we will actually receive four different values in our request related to this slot value.
Value – the same string value that we have always received in our JSON request.
ID – a developer defined unique identifier for this slot value.
Name – the slot value that was selected by the user.
Authority - represents the source for the data provided for the slot. For a custom slot type, the authority is the slot type you defined.
In the example IntentRequest below, you can see how each of these values are resolved. (also see Slot Value Resolutions in the IntentRequest)
{
"type": "IntentRequest",
"intent": {
"name": "GetCharacterIntent",
"slots": {
"Character": {
"name": "MediaType",
"value": "mickey",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "amzn1.er-authority.echo-sdk.<skill_id>.Characters",
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "Mickey Mouse",
"id": "MICKEY"
}
}
]
}
]
}
}
}
}
}
intent.slots[].value – this is the same value your skill would be receiving today, which reflects the value the user spoke.
intent.slots[].resolution.resolutionsPerAuthority.values[].value.id – this is the unique identifier you assigned to your slot value.
intent.slots[].resolutions.resolutionsPerAuthority.values[].value.name – this is the actual slot value that you defined.
intent.slots[].resolutions.resolutionsPerAuthority.authority – this is the slot type that was used.
By taking advantage of the new ID and Name values, our skill can rely on receiving consistent, reliable data, even when our users might be using one of the many synonyms for our slot values. In the past, your skill would have needed to receive all of the possible values, and manually map them back to the data points that are used by your code.
You can always still rely on using the existing value that your user spoke, but Entity Resolution should make the process of determining your user’s specific intent much clearer with use of synonyms and IDs.
We are incredibly excited about this new functionality now available in Skill Builder, and we hope that it improves your skill development experience as well!
If you want to get started now, check out these additional Alexa developer resources:
Developers have built more than 15,000 skills with the Alexa Skills Kit. Explore the stories behind some of these innovations, then start building your own skill. If you’re serious about getting into building voice UIs, we’d like to help you explore. If you publish a skill in July and apply for our promotion, we’ll send you an Echo Dot and some new Alexa swag so you can experiment and daydream.