Normalize text: TN and ITN

POST /v1/text/normalizations

Converts written forms to spoken forms (mode:"tn") or spoken forms to written forms (mode:"itn") without audio. Unknown request fields are rejected, and this endpoint does not consume audio-duration quota. Supported languages and categories are in the Skylark catalog entry under x_edgespeak.normalization.

Guide and examplesText processingLocal Gateway APIAll endpoints

Request body

application/jsonRequired

textstringRequiredRequired, non-empty, up to 256 KiB UTF-8.
languagestringRequiredRequired: a language code, or und to choose readings segment by segment from the text. An unrecognized tag returns 400 normalization_invalid_request; a language without normalization rules returns 422 normalization_language_unsupported. See /docs/languages#normalization for supported languages.
modelstringNormalization model. Defaults to EdgeSpeak/Skylark.Default "EdgeSpeak/Skylark"
modestringtn rewrites written forms as spoken forms; itn does the reverse. Defaults to tn.tn | itnDefault "tn"
top_kintegerNumber of alternatives to return, range 1-16. Defaults to 8; send 1 for the best candidate only.1–16Default 8
classesstring[]Optional non-empty array of categories, for example cardinal, date or money.

Responses

200Normalization candidates. Span offsets are UTF-8 byte ranges in the original input.
taskstringnormalize
modelstring
languagestring
modestringtn | itn
textstringPreserves the whole input.
alternativesobject[]
rankinteger
textstringThe converted paragraph.
spansobject[]
JSON
{
  "task": "normalize",
  "model": "EdgeSpeak/Skylark",
  "language": "en",
  "mode": "tn",
  "text": "Registration is open for the workshop. The fee is $25 and the session starts at 09:30.",
  "alternatives": [
    {
      "rank": 0,
      "text": "Registration is open for the workshop. The fee is twenty five dollars and the session starts at nine thirty.",
      "spans": [
        {
          "start_byte": 50,
          "end_byte": 53,
          "class": "money",
          "source": "$25",
          "output": "twenty five dollars"
        },
        {
          "start_byte": 80,
          "end_byte": 85,
          "class": "time",
          "source": "09:30",
          "output": "nine thirty"
        }
      ]
    }
  ]
}
400Invalid request. Fix the request before retrying; use error.code for program logic and error.param to locate the input.
401Invalid or missing API key.
403Host or origin is not allowed, or the license was rejected. Inspect error.code to tell them apart.
503A required local model is still being prepared (model_downloading) or the service is busy (service_busy). Honor Retry-After when present.