gcloud alpha ml translate detect-language - use the Google Cloud Translation API to detect languages
gcloud alpha ml translate detect-language (--content=CONTENT | --content-file=CONTENT_FILE) [--mime-type=MIME_TYPE] [--model=MODEL] [--zone=ZONE; default="global"] [GCLOUD_WIDE_FLAG ...]
(ALPHA) Detects the language of text in a request.
The following command detects the language of 'What beautiful weather!'
$ gcloud alpha ml translate detect-language \ --content='What beautiful weather!' --zone=us-central1
- Contents group.
Exactly one of these must be specified:
- --content=CONTENT
Content of the input in string format.
- --content-file=CONTENT_FILE
Specify a local file path with content.
- --mime-type=MIME_TYPE
Format of the source text, for example, 'text/html', 'text/plain'. Defaults to 'text/html'.
- --model=MODEL
Language detection model to be used. If not specified, the default (language-detection/default) model is used. Authorization requires the following Google IAM permission on the specified resource model:
cloudtranslate.languageDetectionModels.predict
- --zone=ZONE; default="global"
Location to make calls. Non-global location is required for requests using AutoML models. Currently, only 'us-central1' is supported as a non-global location. Defaults to 'global'.
These flags are available to all commands: --access-token-file, --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.
This command uses the translate/v3beta1 API. The full documentation for this API can be found at: https://cloud.google.com/translate/docs/quickstarts
This command is currently in alpha and might change without notice. If this command fails with API permission errors despite specifying the correct project, you might be trying to access an API with an invitation-only early access allowlist. This variant is also available:
$ gcloud beta ml translate detect-language