Customization for Synthesis Accuracy
  • 13 Sep 2024
  • 3 Minutes to read
  • Contributors
  • PDF

Customization for Synthesis Accuracy

  • PDF

Article summary

Abbreviation management in the Text-to-Speech (TTS) system allows custom pronunciations for abbreviations. Here's a step-by-step explanation and documentation for adding, retrieving, and deleting abbreviations.

Info

This documentation is specifically for on-premise installations of the Text-to-Speech (TTS) system.

1. Adding Abbreviations

Abbreviations can be added for a specific voice-name or language code. The format of the abbreviation data can vary depending on your needs:

Example cURL for Adding Abbreviations for a Specific Voice

This command adds abbreviations for the voice "Jennifer":

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'Content-Type: application/json' \
--data '{
    "voice-name": "Jennifer",
    "abbreviations":
    [
        {"AI": "artificial intelligence"},
        {"NASA": "National Aeronautics and Space Administration"}
    ]
}'
  • voice-name: Specifies the voice for which the abbreviation applies.
  • abbreviations: Contains the list of abbreviation-to-pronunciation pairs.

Example cURL for Adding Abbreviations for a Specific Language

Alternatively, you can add abbreviations based on a language code, such as en-US:

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'Content-Type: application/json' \
--data '{
    "language": "en-US",
    "abbreviations":
    [
        {"AI": "artificial intelligence"},
        {"NASA": "National Aeronautics and Space Administration"}
    ]
}'
  • language: Defines the language for which the abbreviations apply.
  • abbreviations: The list of abbreviation-to-pronunciation pairs specific to the language.
Important Information about Abbreviation Application

When managing abbreviations in the Text-to-Speech (TTS) system, it's essential to understand the scope of their effect:

  • Voice-Specific Abbreviations: If an abbreviation is added for a specific voice, it only affects that particular voice. For example, if an abbreviation like "ASAP" is added for the voice "Jennifer," this pronunciation adjustment will only apply when "Jennifer" is used. Other voices will not be influenced by this abbreviation.

  • Language-Specific Abbreviations: If an abbreviation is added based on a language code, it affects all voices using that language. For example, if you add "ETA" for the language "en-US," every voice using the "en-US" language will apply this abbreviation, regardless of the specific voice selected.

2. Retrieving Abbreviations

You can retrieve the list of abbreviations that were previously added by specifying the voice-name or language. Below is an example:

Example cURL for Retrieving Abbreviations

Retrieving Abbreviations by Language
This cURL command retrieves all abbreviations associated with a particular language code. All voices using this language will apply the retrieved abbreviations.

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'language: en-US' \
--data ''

Retrieving Abbreviations by Voice Name
This cURL command retrieves all abbreviations added specifically for a certain voice. The abbreviations retrieved will only affect the voice you specify.

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'voice-name: Jennifer' \
--data ''

In this case:

  • language: Specifies the language to filter abbreviations (e.g., en-US).
  • voice-name: Specifies the voice to retrieve the abbreviations for (e.g., Jennifer).

Example Response for Retrieving Abbreviations

When you retrieve abbreviations, the system returns details such as the abbreviation, its expansion, and the voice or language it applies to. Below is an example of the response you might receive when retrieving abbreviations for a specific voice:

{
    "abbreviation-count": 2,
    "abbreviations": [
        {
            "abbreviation": "fomo",
            "expansion": "fear of missing out",
            "id": 11,
            "language": "",
            "tenant": "default",
            "voice-name": "Jennifer"
        },
        {
            "abbreviation": "asap",
            "expansion": "as soon as possible",
            "id": 12,
            "language": "",
            "tenant": "default",
            "voice-name": "Jennifer"
        }
    ]
}

In this example:

  • "abbreviation-count": Indicates the total number of abbreviations returned (in this case, 2).
  • "abbreviations": Contains an array of abbreviation objects, each of which includes:
    • "abbreviation": The abbreviation in use (e.g., "fomo").
    • "expansion": The full phrase that the abbreviation represents (e.g., "fear of missing out").
    • "id": The unique identifier for the abbreviation.
    • "language": If the abbreviation applies to a specific language, it will be noted here. In this case, it’s blank as the abbreviation is tied to a voice.
    • "tenant": Specifies the tenant context (in this case, "default").
    • "voice-name": Indicates that these abbreviations are specific to the voice "Jennifer."

3. Deleting an Abbreviation

To delete a specific abbreviation, you use the abbreviation’s unique ID in the request URL. Here's an example of how to delete an abbreviation with the ID 12:

Example cURL for Deleting an Abbreviation

curl --location --request DELETE '{{ManagementAddress}}/v1/speech/synthesis/abbreviations/12'
  • DELETE: Indicates the HTTP method for deletion.
  • /abbreviations/12: Refers to the specific abbreviation by its unique ID.

Notes:

  • Make sure you have appropriate authentication headers (if required) in your requests.
  • You can manage abbreviations by voice-name or language depending on your needs.
  • Ensure correct handling of abbreviation IDs when deleting entries.

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.