Enhancements

Create a new postprocessing dictionary

Changed on

A postprocessing dictionary is a list of find/replace rules applied to the source-language transcript of a speech enhancement after speech recognition and before translation: it reliably corrects spellings, standardizes formatting, removes filler words or censors terms, and the corrected text carries over into every translated text track. Unlike a speech dictionary (a hint to the speech recognition) the rules are always applied. Connect a postprocessing dictionary to an ingest via the postprocessingDictionary field of the speech enhancement entry; the dictionary language must match that enhancement's sourceLanguage. Each entry has the format "replacement|pattern,pattern" (an empty replacement removes the matched word). Entries are cleaned up automatically (whitespace normalized, empty and duplicate entries dropped); entries without a pattern, with spaces in a pattern, or rejected by the captioning provider (e.g. an invalid regular expression) fail with invalid_value.

post/enhancements/speech/postprocessing-dictionaries

Request

  • Base URL
    https://api.theo.live/v2
  • Auth
    HTTP basic

Request body

namestring required

Name of the postprocessing dictionary

languagestring required

IETF BCP 47 language tag of the transcript the rules apply to (e.g. "en", "en-US"). Must match the sourceLanguage of the speech enhancement the dictionary is used with

termsstring[] required

List of find/replace rules applied to the source-language transcript after speech recognition and before translation. One rule per entry in the format "replacement|pattern,pattern": every transcript word matching one of the comma-separated patterns is replaced by the replacement. A pattern matches an entire word, may be a regular expression and must not contain spaces; the replacement may contain spaces and may be empty to remove the matched word ("|basically,literally"). Entries are cleaned up automatically: whitespace is normalized, spaces around "|" and "," are removed, and empty or duplicate entries are dropped. Entries without a pattern or with spaces in a pattern are rejected. At most 1000 entries.

Example request

{
  "terms": [
    "OptiView|Optiview,Opti-view,Optivue",
    "New York|NewYork,Newyork",
    "|basically,literally",
    "Dolby|[D|d]olby"
  ]
}

Response

Postprocessing dictionary created successfully

Example response

{
  "data": {
    "terms": [
      "OptiView|Optiview,Opti-view,Optivue",
      "New York|NewYork,Newyork",
      "|basically,literally",
      "Dolby|[D|d]olby"
    ]
  }
}

Changes