Method: projects.locations.adaptiveMtTranslate

Translate text using Adaptive MT.

HTTP request

POST https://translate.googleapis.com/v3/{parent=projects/*/locations/*}:adaptiveMtTranslate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "dataset": string,
  "content": [
    string
  ],
  "referenceSentenceConfig": {
    object (ReferenceSentenceConfig)
  }
}
Fields
dataset

string

Required. The resource name for the dataset to use for adaptive MT. projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}

content[]

string

Required. The content of the input in string format.

referenceSentenceConfig

object (ReferenceSentenceConfig)

Configuration for caller provided reference sentences.

Response body

An locations.adaptiveMtTranslate response.

If successful, the response body contains data with the following structure:

JSON representation
{
  "translations": [
    {
      object (AdaptiveMtTranslation)
    }
  ],
  "languageCode": string
}
Fields
translations[]

object (AdaptiveMtTranslation)

Output only. The translation.

languageCode

string

Output only. The translation's language code.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-translation
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ReferenceSentenceConfig

Message of caller-provided reference configuration.

JSON representation
{
  "referenceSentencePairLists": [
    {
      object (ReferenceSentencePairList)
    }
  ],
  "sourceLanguageCode": string,
  "targetLanguageCode": string
}
Fields
referenceSentencePairLists[]

object (ReferenceSentencePairList)

Reference sentences pair lists. Each list will be used as the references to translate the sentence under "content" field at the corresponding index. Length of the list is required to be equal to the length of "content" field.

sourceLanguageCode

string

Source language code.

targetLanguageCode

string

Target language code.

ReferenceSentencePairList

A list of reference sentence pairs.

JSON representation
{
  "referenceSentencePairs": [
    {
      object (ReferenceSentencePair)
    }
  ]
}
Fields
referenceSentencePairs[]

object (ReferenceSentencePair)

Reference sentence pairs.

ReferenceSentencePair

A pair of sentences used as reference in source and target languages.

JSON representation
{
  "sourceSentence": string,
  "targetSentence": string
}
Fields
sourceSentence

string

Source sentence in the sentence pair.

targetSentence

string

Target sentence in the sentence pair.

AdaptiveMtTranslation

An AdaptiveMt translation.

JSON representation
{
  "translatedText": string
}
Fields
translatedText

string

Output only. The translated text.