NAME

gcloud alpha ml translate detect-language - use the Google Cloud Translation API to detect languages

SYNOPSIS

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 ...]

DESCRIPTION

(ALPHA) Detects the language of text in a request.

EXAMPLES

The following command detects the language of 'What beautiful weather!'

$ gcloud alpha ml translate detect-language \ --content='What beautiful weather!' --zone=us-central1

REQUIRED FLAGS

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.

OPTIONAL FLAGS

--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'.

GCLOUD WIDE FLAGS

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.

API REFERENCE

This command uses the translate/v3beta1 API. The full documentation for this API can be found at: https://cloud.google.com/translate/docs/quickstarts

NOTES

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