Menu
Amazon Polly
Developer Guide

Managing Lexicons Using the Amazon Polly Console

You can use the Amazon Polly console to upload, download, apply, filter, and delete lexicons. The following procedures demonstrate each of these processes.

Uploading Lexicons Using the Console

To use a pronunciation lexicon, you must first upload it. There are two locations on the console from which you can upload a lexicon, the Text-to-Speech tab and the Lexicons tab.

The following processes describe how to add lexicons that you can use to customize how words and phrases uncommon to the chosen language are pronounced.

To add a lexicon from the Lexicons Tab

  1. Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/.

  2. Choose the Lexicons tab.

  3. Choose Upload.

  4. Browse to find the lexicon that you want to upload. You can use only PLS files that use the .pls and .xml extensions.

  5. Choose Open. If a lexicon by the same name (whether a .pls or .xml file) already exists, uploading the lexicon will overwrite the existing lexicon.

To add a lexicon from the Text-to-Speech Tab

  1. Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/.

  2. Choose the Text-to-Speech tab.

  3. Choose Customize pronunciation of words or phrases using lexicons, then choose Upload lexicon.

  4. Browse to find the lexicon that you want to upload. You can use only PLS files that use the .pls and .xml extensions.

  5. Choose Open. If a lexicon with the same name (whether a .pls or .xml file) already exists, uploading the lexicon will overwrite the existing lexicon.

Applying Lexicons Using the Console (Synthesize Speech)

The following procedure demonstrates how to apply a lexicon to your input text by applying the W3c.pls lexicon to substitute "World Wide Web Consortium" for "W3C". If you apply multiple lexicons to your text they are applied in a top-down order with the first match taking precedence over later matches. A lexicon is applied to the text only if the language specified in the lexicon is the same as the language chosen.

You can apply a lexicon to plain text or SSML input.

Example – Applying the W3C.pls Lexicon

To create the lexicon you'll need for this exercise, see Using the PutLexicon Operation. Use a plain text editor to create the W3C.pls lexicon shown at the top of the topic. Remember where you save this file.

To apply the W3C.pls lexicon to your input

In this example we introduce a lexicon to substitute "World Wide Web Consortium" for "W3C". Compare the results of this exercise with that of Using SSML with the Amazon Polly Console for both US English and another language.

  1. Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/.

  2. Do one of the following:

    • Choose the Plain text tab and then type or paste this text into the text input box.

      Copy
      He was caught up in the game. In the middle of the 10/3/2014 W3C meeting he shouted, "Score!" quite loudly.
    • Choose the SSML tab and then type or paste this text into the text input box.

      Copy
      <speak>He wasn't paying attention.<break time="1s"/> In the middle of the 10/3/2014 W3C meeting he shouted, "Score!" quite loudly.</speak>
  3. From the Choose a language and region list, choose English US, then choose a voice you want to use for this text.

  4. Choose Customize pronunciation of words or phrases using lexicons.

  5. From the list of lexicons, choose W3C (English, US).

    If the W3C (English, US) lexicon is not listed, choose Upload lexicon and upload it, then choose it from the list. To create this lexicon, see Using the PutLexicon Operation.

  6. To listen to the speech immediately, choose Listen to speech.

  7. To save the speech to a file,

    1. Choose Save speech to MP3.

    2. To change to a different file format, choose Change file format, choose the file format you want, and then choose Change.

Repeat the previous steps, but choose a different language and notice the difference in the output.

Filtering the Lexicon List Using the Console

The following procedure describes how to filter the lexicons list so that only lexicons of a chosen language are displayed.

To filter the lexicons listed by language

  1. Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/.

  2. Choose the Lexicons tab.

  3. Choose Filter.

  4. From the list of languages, choose the language you want to filter on.

    The list displays only the lexicons for the chosen language.

Downloading Lexicons Using the Console

The following process describes how to download one or more lexicons. You can add, remove, or modify lexicon entries in the file and then upload it again to keep your lexicon up-to-date.

To download one or more lexicons

  1. Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/.

  2. Choose the Lexicons tab.

  3. Choose the lexicon or lexicons you want to download.

    1. To download a single lexicon, choose its name from the list.

    2. To download multiple lexicons as a single compressed archive file, select the check box next to each entry in the list that you want to download.

  4. Choose Download.

  5. Open the folder where you want to download the lexicon.

  6. Choose Save.

Deleting a Lexicon Using the Console

To delete a lexicon

The following process describes how to delete a lexicon. After deleting the lexicon, you must add it back before you can use it again. You can delete one or more lexicons at the same time by selecting the check boxes next to individual lexicons.

  1. Sign in to the AWS Management Console and open the Amazon Polly console at https://console.aws.amazon.com/polly/.

  2. Choose the Lexicons tab.

  3. Choose one or more lexicons that you want to delete from the list.

  4. Choose Delete.

  5. Choose Delete to remove the lexicon from the region or Cancel to keep it.