GCLOUD_ML_LANGUAGE_ANALYZE-SENTIMENT(1)

NAME

gcloud ml language analyze-sentiment - use Google Cloud Natural Language API to identify sentiments in a text

SYNOPSIS

gcloud ml language analyze-sentiment (--content=CONTENT | --content-file=CONTENT_FILE) [--content-type=CONTENT_TYPE; default="PLAIN_TEXT"] [--encoding-type=ENCODING_TYPE; default="UTF8"] [--language=LANGUAGE] [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
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. This command requires a service account from a project that has enabled the Natural Language API. To learn about using service accounts with the Natural Language API, please go to https://cloud.google.com/natural-language/docs/getting-started. Step 2 under the "Make an entity analysis request" section will give directions for using service accounts in gcloud. Currently English, Spanish, and Japanese are supported.

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.

OPTIONAL FLAGS

    --content-type=CONTENT_TYPE; default="PLAIN_TEXT"
        Specify the format of the input text. CONTENT_TYPE must be one of: PLAIN_TEXT, HTML.

    --encoding-type=ENCODING_TYPE; default="UTF8"
        The encoding type used by the API to calculate offsets. If NONE, those offsets are not calculated. This is an optional flag only used for the entity mentions in results, and does not affect how the input is read or analyzed. ENCODING_TYPE must be one of: NONE, UTF8, UTF16, UTF32.

    --language=LANGUAGE
        Specify the language of the input text. If omitted, the server will attempt to auto-detect. Both ISO (such as en or es) and BCP-47 (such as en-US or ja-JP) language codes are accepted.

GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.