- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- ReferenceSentenceConfig
- ReferenceSentencePairList
- ReferenceSentencePair
- AdaptiveMtTranslation
- Try it!
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 |
Required. Location to make a regional call. Format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"dataset": string,
"content": [
string
],
"referenceSentenceConfig": {
object ( |
Fields | |
---|---|
dataset |
Required. The resource name for the dataset to use for adaptive MT. |
content[] |
Required. The content of the input in string format. |
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 ( |
Fields | |
---|---|
translations[] |
Output only. The translation. |
languageCode |
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 ( |
Fields | |
---|---|
referenceSentencePairLists[] |
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 |
Source language code. |
targetLanguageCode |
Target language code. |
ReferenceSentencePairList
A list of reference sentence pairs.
JSON representation |
---|
{
"referenceSentencePairs": [
{
object ( |
Fields | |
---|---|
referenceSentencePairs[] |
Reference sentence pairs. |
ReferenceSentencePair
A pair of sentences used as reference in source and target languages.
JSON representation |
---|
{ "sourceSentence": string, "targetSentence": string } |
Fields | |
---|---|
sourceSentence |
Source sentence in the sentence pair. |
targetSentence |
Target sentence in the sentence pair. |
AdaptiveMtTranslation
An AdaptiveMt translation.
JSON representation |
---|
{ "translatedText": string } |
Fields | |
---|---|
translatedText |
Output only. The translated text. |