Learn
Use Synonyms in Voice Interaction
Testing: Synonyms

In this exercise, you will learn how to test synonyms in your Alexa skill.

Make a dummy endpoint

  1. In the Amazon Developer Console, click on the Build tab, then select the Endpoint section in the left sidebar. In this section, select HTTPS, and type in https://example.com in the Default Region only. (We will be creating a real endpoint on AWS Lambda later, but for now, we don’t really need it).
  2. For the SSL Certificate Type, select the second option: “My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority”
  3. Click Save Endpoints button at the top of your screen.

Testing our Synonyms

Try matching a synonym to the slot value using the steps below.

  1. Click on the Test tab in the header.
  2. Make sure testing is enabled for your skill by selecting the toggle in the top left corner of the web page.
  3. In the Alexa Test Simulator panel — type, ask movie match to find me a combat movie and press enter. Remember we had added combat, battle, fight, war as the synonyms for the slot value of action.
  4. Alexa will respond with “There was a problem with the requested skill’s response”, and the JSON Output would be ‘null’. This is expected behavior since our endpoint (https://example.com) isn’t real.
  5. More importantly, you will see JSON Input, that was generated for your skill (similar to one on the right) based on the user request. Let’s inspect this JSON to check if the synonym was resolved successfully.

Inspecting the JSON Input

If you scroll down to the request property in the JSON input, you will see that there is an object called resolutions which contains some additional information relevant to our slots. The value that we used, combat, successfully resolved to the slot value action. We know this because the resolutions node contains the status code of ER_SUCCESS_MATCH. ER in ER_SUCCESS_MATCH stands for Entity Resolution. The status code indicates the skill successfully matched the synonym (combat) to the slot value (action).

Additionally, in the values node, you can see that the IntentRequest still passes action as the value.

Instructions

Inspect the JSON input for the example above. Notice the genre value is combat and the resolved value a few lines below it is action.

Folder Icon

Take this course for free

Already have an account?