Skip to content

Detect Targeted Sentiment

comprehend_detect_targeted_sentiment R Documentation

Inspects the input text and returns a sentiment analysis for each entity identified in the text

Description

Inspects the input text and returns a sentiment analysis for each entity identified in the text.

For more information about targeted sentiment, see Targeted sentiment in the Amazon Comprehend Developer Guide.

Usage

comprehend_detect_targeted_sentiment(Text, LanguageCode)

Arguments

Text

[required] A UTF-8 text string. The maximum string length is 5 KB.

LanguageCode

[required] The language of the input documents. Currently, English is the only supported language.

Value

A list with the following syntax:

list(
  Entities = list(
    list(
      DescriptiveMentionIndex = list(
        123
      ),
      Mentions = list(
        list(
          Score = 123.0,
          GroupScore = 123.0,
          Text = "string",
          Type = "PERSON"|"LOCATION"|"ORGANIZATION"|"FACILITY"|"BRAND"|"COMMERCIAL_ITEM"|"MOVIE"|"MUSIC"|"BOOK"|"SOFTWARE"|"GAME"|"PERSONAL_TITLE"|"EVENT"|"DATE"|"QUANTITY"|"ATTRIBUTE"|"OTHER",
          MentionSentiment = list(
            Sentiment = "POSITIVE"|"NEGATIVE"|"NEUTRAL"|"MIXED",
            SentimentScore = list(
              Positive = 123.0,
              Negative = 123.0,
              Neutral = 123.0,
              Mixed = 123.0
            )
          ),
          BeginOffset = 123,
          EndOffset = 123
        )
      )
    )
  )
)

Request syntax

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