File: //snap/google-cloud-cli/396/help/man/man1/gcloud_alpha_ml_language_analyze-sentiment.1
.TH "GCLOUD_ALPHA_ML_LANGUAGE_ANALYZE\-SENTIMENT" 1
.SH "NAME"
.HP
gcloud alpha ml language analyze\-sentiment \- use Google Cloud Natural Language API to identify sentiments in a text
.SH "SYNOPSIS"
.HP
\f5gcloud alpha ml language analyze\-sentiment\fR (\fB\-\-content\fR=\fICONTENT\fR\ |\ \fB\-\-content\-file\fR=\fICONTENT_FILE\fR) [\fB\-\-content\-type\fR=\fICONTENT_TYPE\fR;\ default="plain\-text"] [\fB\-\-encoding\-type\fR=\fIENCODING_TYPE\fR;\ default="utf8"] [\fB\-\-language\fR=\fILANGUAGE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Sentiment Analysis inspects the given text and identifies the
prevailing emotional opinion within the text, especially to determine a writer's
attitude as positive, negative, or neutral.
Currently English, Spanish, Japanese, Chinese (Simplified and Traditional),
French, German, Italian, Korean, and Portuguese are supported.
.SH "EXAMPLES"
To analyze sentiment in raw content 'I love puppies.':
.RS 2m
$ gcloud alpha ml language analyze\-sentiment \e
\-\-content='I love puppies.'
.RE
To analyze sentiment in file 'myfile.txt':
.RS 2m
$ gcloud alpha ml language analyze\-sentiment \e
\-\-content\-file='myfile.txt'
.RE
To analyze sentiment in a remote file 'gs://bucket_name/mycontent.html' for
Japanese language using UTF\-8 encoding:
.RS 2m
$ gcloud alpha ml language analyze\-sentiment \e
\-\-content\-file='gs://bucket_name/mycontent.html' \e
\-\-content\-type=HTML \-\-encoding\-type=utf8 \-\-language=ja\-JP
.RE
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
Exactly one of these must be specified:
.RS 2m
.TP 2m
\fB\-\-content\fR=\fICONTENT\fR
Specify input text on the command line. Useful for experiments, or for extremely
short text.
.TP 2m
\fB\-\-content\-file\fR=\fICONTENT_FILE\fR
Specify a local file or Google Cloud Storage (format \f5gs://bucket/object\fR)
file path containing the text to be analyzed. More useful for longer text or
data output from another system.
.RE
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-content\-type\fR=\fICONTENT_TYPE\fR; default="plain\-text"
Specify the format of the input text. \fICONTENT_TYPE\fR must be one of:
\fBhtml\fR, \fBplain\-text\fR.
.TP 2m
\fB\-\-encoding\-type\fR=\fIENCODING_TYPE\fR; default="utf8"
The encoding type used by the API to calculate offsets. If set to \f5none\fR,
encoding\-dependent offsets will be set at \-1. This is an optional flag only
used for the entity mentions in results, and does not affect how the input is
read or analyzed. \fIENCODING_TYPE\fR must be one of: \fBnone\fR, \fButf16\fR,
\fButf32\fR, \fButf8\fR.
.TP 2m
\fB\-\-language\fR=\fILANGUAGE\fR
Specify the language of the input text. If omitted, the server will attempt to
auto\-detect. Both ISO (such as \f5en\fR or \f5es\fR) and BCP\-47 (such as
\f5en\-US\fR or \f5ja\-JP\fR) language codes are accepted.
.RE
.sp
.SH "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 \fB$ gcloud help\fR for details.
.SH "API REFERENCE"
This command uses the \fBlanguage/v1beta2\fR API. The full documentation for
this API can be found at: https://cloud.google.com/natural\-language/
.SH "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. These variants are also available:
.RS 2m
$ gcloud ml language analyze\-sentiment
.RE
.RS 2m
$ gcloud beta ml language analyze\-sentiment
.RE