amazonka-comprehend-2.0: Amazon Comprehend SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Comprehend.DetectSentiment

Description

Inspects text and returns an inference of the prevailing sentiment (POSITIVE, NEUTRAL, MIXED, or NEGATIVE).

Synopsis

Creating a Request

data DetectSentiment Source #

See: newDetectSentiment smart constructor.

Constructors

DetectSentiment' 

Fields

  • text :: Sensitive Text

    A UTF-8 text string. The maximum string size is 5 KB.

    Amazon Comprehend performs real-time sentiment analysis on the first 500 characters of the input text and ignores any additional text in the input.

  • languageCode :: LanguageCode

    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.

Instances

Instances details
ToJSON DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

ToHeaders DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

ToPath DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

ToQuery DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

AWSRequest DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

Associated Types

type AWSResponse DetectSentiment #

Generic DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

Associated Types

type Rep DetectSentiment :: Type -> Type #

Show DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

NFData DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

Methods

rnf :: DetectSentiment -> () #

Eq DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

Hashable DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

type AWSResponse DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

type Rep DetectSentiment Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

type Rep DetectSentiment = D1 ('MetaData "DetectSentiment" "Amazonka.Comprehend.DetectSentiment" "amazonka-comprehend-2.0-Ko6GCjAQF2RARapSdPn69F" 'False) (C1 ('MetaCons "DetectSentiment'" 'PrefixI 'True) (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Sensitive Text)) :*: S1 ('MetaSel ('Just "languageCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LanguageCode)))

newDetectSentiment Source #

Create a value of DetectSentiment with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

DetectSentiment, detectSentiment_text - A UTF-8 text string. The maximum string size is 5 KB.

Amazon Comprehend performs real-time sentiment analysis on the first 500 characters of the input text and ignores any additional text in the input.

DetectSentiment, detectSentiment_languageCode - 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.

Request Lenses

detectSentiment_text :: Lens' DetectSentiment Text Source #

A UTF-8 text string. The maximum string size is 5 KB.

Amazon Comprehend performs real-time sentiment analysis on the first 500 characters of the input text and ignores any additional text in the input.

detectSentiment_languageCode :: Lens' DetectSentiment LanguageCode Source #

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.

Destructuring the Response

data DetectSentimentResponse Source #

See: newDetectSentimentResponse smart constructor.

Constructors

DetectSentimentResponse' 

Fields

Instances

Instances details
Generic DetectSentimentResponse Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

Associated Types

type Rep DetectSentimentResponse :: Type -> Type #

Show DetectSentimentResponse Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

NFData DetectSentimentResponse Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

Methods

rnf :: DetectSentimentResponse -> () #

Eq DetectSentimentResponse Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

type Rep DetectSentimentResponse Source # 
Instance details

Defined in Amazonka.Comprehend.DetectSentiment

type Rep DetectSentimentResponse = D1 ('MetaData "DetectSentimentResponse" "Amazonka.Comprehend.DetectSentiment" "amazonka-comprehend-2.0-Ko6GCjAQF2RARapSdPn69F" 'False) (C1 ('MetaCons "DetectSentimentResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "sentiment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe SentimentType)) :*: (S1 ('MetaSel ('Just "sentimentScore") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe SentimentScore)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newDetectSentimentResponse Source #

Create a value of DetectSentimentResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

DetectSentimentResponse, detectSentimentResponse_sentiment - The inferred sentiment that Amazon Comprehend has the highest level of confidence in.

DetectSentimentResponse, detectSentimentResponse_sentimentScore - An object that lists the sentiments, and their corresponding confidence levels.

$sel:httpStatus:DetectSentimentResponse', detectSentimentResponse_httpStatus - The response's http status code.

Response Lenses

detectSentimentResponse_sentiment :: Lens' DetectSentimentResponse (Maybe SentimentType) Source #

The inferred sentiment that Amazon Comprehend has the highest level of confidence in.

detectSentimentResponse_sentimentScore :: Lens' DetectSentimentResponse (Maybe SentimentScore) Source #

An object that lists the sentiments, and their corresponding confidence levels.