gcloud ml language classify-text
Stay organized with collections
Save and categorize content based on your preferences.
- NAME
-
- gcloud ml language classify-text - classifies input document into categories
- SYNOPSIS
-
-
gcloud ml language classify-text(--content=CONTENT|--content-file=CONTENT_FILE) [--content-type=CONTENT_TYPE; default="plain-text"] [--language=LANGUAGE] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
Classifies input document into categories. Returns a list of categories
representing the document. Only the most relevant categories a document are
returned e.g. if
/Scienceand/Science/Astronomyboth apply to a document, then only the/Science/Astronomycategory is returned, as it is the more specific result.Currently only English is supported for this feature.
- EXAMPLES
-
To classify text in raw content 'Long Political Text.':
gcloudmllanguageclassify-text--content='Long Political Text.'To classify text in file 'myfile.txt':
gcloudmllanguageclassify-text--content-file='myfile.txt'To classify text in a remote file 'gs://bucket_name/mycontent.html' for Japanese language:
gcloudmllanguageclassify-text--content-file='gs://bucket_name/mycontent.html'--content-type=HTML--language=ja-JP - REQUIRED FLAGS
-
-
Exactly one of these must be specified:
--content=CONTENT- Specify input text on the command line. Useful for experiments, or for extremely short text.
--content-file=CONTENT_FILE-
Specify a local file or Google Cloud Storage (format
gs://bucket/object) file path containing the text to be analyzed. More useful for longer text or data output from another system.
-
Exactly one of these must be specified:
- OPTIONAL FLAGS
-
--content-type=CONTENT_TYPE; default="plain-text"-
Specify the format of the input text.
CONTENT_TYPEmust be one of:html,plain-text. --language=LANGUAGE-
Specify the language of the input text. If omitted, the server will attempt to
auto-detect. Both ISO (such as
enores) and BCP-47 (such asen-USorja-JP) language codes are accepted.
- 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 helpfor details. - API REFERENCE
-
This command uses the
language/v1API. The full documentation for this API can be found at: https://cloud.google.com/natural-language/ - NOTES
-
These variants are also available:
gcloudalphamllanguageclassify-textgcloudbetamllanguageclassify-text