Skip to content

Batch Detect Sentiment

comprehend_batch_detect_sentiment R Documentation

Inspects a batch of documents and returns an inference of the prevailing sentiment, POSITIVE, NEUTRAL, MIXED, or NEGATIVE, in each one

Description

Inspects a batch of documents and returns an inference of the prevailing sentiment, POSITIVE, NEUTRAL, MIXED, or NEGATIVE, in each one.

Usage

comprehend_batch_detect_sentiment(TextList, LanguageCode)

Arguments

TextList

[required] A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size of each document is 5 KB.

LanguageCode

[required] The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.

Value

A list with the following syntax:

list(
  ResultList = list(
    list(
      Index = 123,
      Sentiment = "POSITIVE"|"NEGATIVE"|"NEUTRAL"|"MIXED",
      SentimentScore = list(
        Positive = 123.0,
        Negative = 123.0,
        Neutral = 123.0,
        Mixed = 123.0
      )
    )
  ),
  ErrorList = list(
    list(
      Index = 123,
      ErrorCode = "string",
      ErrorMessage = "string"
    )
  )
)

Request syntax

svc$batch_detect_sentiment(
  TextList = list(
    "string"
  ),
  LanguageCode = "en"|"es"|"fr"|"de"|"it"|"pt"|"ar"|"hi"|"ja"|"ko"|"zh"|"zh-TW"
)