Reference documentation and code samples for the Cloud Translation V3 Client class Model.
A trained translation model.
Generated from protobuf messagegoogle.cloud.translation.v3.Model
Namespace
Google \ Cloud \ Translate \ V3
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
The resource name of the model, in form ofprojects/{project-number-or-id}/locations/{location_id}/models/{model_id}
↳ display_name
string
The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.
↳ dataset
string
The dataset from which the model is trained, in form ofprojects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}
↳ source_language_code
string
Output only. The BCP-47 language code of the source language.
↳ target_language_code
string
Output only. The BCP-47 language code of the target language.
↳ train_example_count
int
Output only. Number of examples (sentence pairs) used to train the model.
↳ validate_example_count
int
Output only. Number of examples (sentence pairs) used to validate the model.
↳ test_example_count
int
Output only. Number of examples (sentence pairs) used to test the model.
Output only. Timestamp when this model was last updated.
getName
The resource name of the model, in form ofprojects/{project-number-or-id}/locations/{location_id}/models/{model_id}
Returns
Type
Description
string
setName
The resource name of the model, in form ofprojects/{project-number-or-id}/locations/{location_id}/models/{model_id}
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDisplayName
The name of the model to show in the interface. The name can be
up to 32 characters long and can consist only of ASCII Latin letters A-Z
and a-z, underscores (_), and ASCII digits 0-9.
Returns
Type
Description
string
setDisplayName
The name of the model to show in the interface. The name can be
up to 32 characters long and can consist only of ASCII Latin letters A-Z
and a-z, underscores (_), and ASCII digits 0-9.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDataset
The dataset from which the model is trained, in form ofprojects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}
Returns
Type
Description
string
setDataset
The dataset from which the model is trained, in form ofprojects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSourceLanguageCode
Output only. The BCP-47 language code of the source language.
Returns
Type
Description
string
setSourceLanguageCode
Output only. The BCP-47 language code of the source language.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getTargetLanguageCode
Output only. The BCP-47 language code of the target language.
Returns
Type
Description
string
setTargetLanguageCode
Output only. The BCP-47 language code of the target language.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getTrainExampleCount
Output only. Number of examples (sentence pairs) used to train the model.
Returns
Type
Description
int
setTrainExampleCount
Output only. Number of examples (sentence pairs) used to train the model.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getValidateExampleCount
Output only. Number of examples (sentence pairs) used to validate the
model.
Returns
Type
Description
int
setValidateExampleCount
Output only. Number of examples (sentence pairs) used to validate the
model.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getTestExampleCount
Output only. Number of examples (sentence pairs) used to test the model.
Returns
Type
Description
int
setTestExampleCount
Output only. Number of examples (sentence pairs) used to test the model.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getCreateTime
Output only. Timestamp when the model resource was created, which is also
when the training started.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Translation V3 Client - Class Model (2.0.3)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.3 (latest)](/php/docs/reference/cloud-translate/latest/V3.Model)\n- [2.0.2](/php/docs/reference/cloud-translate/2.0.2/V3.Model)\n- [1.21.0](/php/docs/reference/cloud-translate/1.21.0/V3.Model)\n- [1.20.2](/php/docs/reference/cloud-translate/1.20.2/V3.Model)\n- [1.19.0](/php/docs/reference/cloud-translate/1.19.0/V3.Model)\n- [1.18.1](/php/docs/reference/cloud-translate/1.18.1/V3.Model)\n- [1.17.7](/php/docs/reference/cloud-translate/1.17.7/V3.Model)\n- [1.16.0](/php/docs/reference/cloud-translate/1.16.0/V3.Model)\n- [1.15.4](/php/docs/reference/cloud-translate/1.15.4/V3.Model)\n- [1.14.3](/php/docs/reference/cloud-translate/1.14.3/V3.Model)\n- [1.13.3](/php/docs/reference/cloud-translate/1.13.3/V3.Model)\n- [1.12.12](/php/docs/reference/cloud-translate/1.12.12/V3.Model) \nReference documentation and code samples for the Cloud Translation V3 Client class Model.\n\nA trained translation model.\n\nGenerated from protobuf message `google.cloud.translation.v3.Model`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Translate \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nThe resource name of the model, in form of\n`projects/{project-number-or-id}/locations/{location_id}/models/{model_id}`\n\n### setName\n\nThe resource name of the model, in form of\n`projects/{project-number-or-id}/locations/{location_id}/models/{model_id}`\n\n### getDisplayName\n\nThe name of the model to show in the interface. The name can be\nup to 32 characters long and can consist only of ASCII Latin letters A-Z\nand a-z, underscores (_), and ASCII digits 0-9.\n\n### setDisplayName\n\nThe name of the model to show in the interface. The name can be\nup to 32 characters long and can consist only of ASCII Latin letters A-Z\nand a-z, underscores (_), and ASCII digits 0-9.\n\n### getDataset\n\nThe dataset from which the model is trained, in form of\n`projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}`\n\n### setDataset\n\nThe dataset from which the model is trained, in form of\n`projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}`\n\n### getSourceLanguageCode\n\nOutput only. The BCP-47 language code of the source language.\n\n### setSourceLanguageCode\n\nOutput only. The BCP-47 language code of the source language.\n\n### getTargetLanguageCode\n\nOutput only. The BCP-47 language code of the target language.\n\n### setTargetLanguageCode\n\nOutput only. The BCP-47 language code of the target language.\n\n### getTrainExampleCount\n\nOutput only. Number of examples (sentence pairs) used to train the model.\n\n### setTrainExampleCount\n\nOutput only. Number of examples (sentence pairs) used to train the model.\n\n### getValidateExampleCount\n\nOutput only. Number of examples (sentence pairs) used to validate the\nmodel.\n\n### setValidateExampleCount\n\nOutput only. Number of examples (sentence pairs) used to validate the\nmodel.\n\n### getTestExampleCount\n\nOutput only. Number of examples (sentence pairs) used to test the model.\n\n### setTestExampleCount\n\nOutput only. Number of examples (sentence pairs) used to test the model.\n\n### getCreateTime\n\nOutput only. Timestamp when the model resource was created, which is also\nwhen the training started.\n\n### hasCreateTime\n\n### clearCreateTime\n\n### setCreateTime\n\nOutput only. Timestamp when the model resource was created, which is also\nwhen the training started.\n\n### getUpdateTime\n\nOutput only. Timestamp when this model was last updated.\n\n### hasUpdateTime\n\n### clearUpdateTime\n\n### setUpdateTime\n\nOutput only. Timestamp when this model was last updated."]]