amazonka-comprehend-1.6.0: Amazon Comprehend SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Comprehend.DetectSentiment

Contents

Description

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

Synopsis

Creating a Request

detectSentiment Source #

Creates a value of DetectSentiment with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • dsText - A UTF-8 text string. Each string must contain fewer that 5,000 bytes of UTF-8 encoded characters.
  • dsLanguageCode - The RFC 5646 language code for the input text. If you don't specify a language code, Amazon Comprehend detects the dominant language. If you specify the code for a language that Amazon Comprehend does not support, it returns and UnsupportedLanguageException . For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.

data DetectSentiment Source #

See: detectSentiment smart constructor.

Instances

Eq DetectSentiment Source # 
Data DetectSentiment Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DetectSentiment -> c DetectSentiment #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DetectSentiment #

toConstr :: DetectSentiment -> Constr #

dataTypeOf :: DetectSentiment -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DetectSentiment) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DetectSentiment) #

gmapT :: (forall b. Data b => b -> b) -> DetectSentiment -> DetectSentiment #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DetectSentiment -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DetectSentiment -> r #

gmapQ :: (forall d. Data d => d -> u) -> DetectSentiment -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DetectSentiment -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DetectSentiment -> m DetectSentiment #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DetectSentiment -> m DetectSentiment #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DetectSentiment -> m DetectSentiment #

Read DetectSentiment Source # 
Show DetectSentiment Source # 
Generic DetectSentiment Source # 
Hashable DetectSentiment Source # 
ToJSON DetectSentiment Source # 
NFData DetectSentiment Source # 

Methods

rnf :: DetectSentiment -> () #

AWSRequest DetectSentiment Source # 
ToHeaders DetectSentiment Source # 
ToPath DetectSentiment Source # 
ToQuery DetectSentiment Source # 
type Rep DetectSentiment Source # 
type Rep DetectSentiment = D1 * (MetaData "DetectSentiment" "Network.AWS.Comprehend.DetectSentiment" "amazonka-comprehend-1.6.0-7ky9kDszQAoCEHl21SoVpv" False) (C1 * (MetaCons "DetectSentiment'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_dsText") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "_dsLanguageCode") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * LanguageCode))))
type Rs DetectSentiment Source # 

Request Lenses

dsText :: Lens' DetectSentiment Text Source #

A UTF-8 text string. Each string must contain fewer that 5,000 bytes of UTF-8 encoded characters.

dsLanguageCode :: Lens' DetectSentiment LanguageCode Source #

The RFC 5646 language code for the input text. If you don't specify a language code, Amazon Comprehend detects the dominant language. If you specify the code for a language that Amazon Comprehend does not support, it returns and UnsupportedLanguageException . For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.

Destructuring the Response

detectSentimentResponse Source #

Creates a value of DetectSentimentResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • dsrsSentiment - The inferred sentiment that Amazon Comprehend has the highest level of confidence in.
  • dsrsSentimentScore - An object that lists the sentiments, and their corresponding confidence levels.
  • dsrsResponseStatus - -- | The response status code.

data DetectSentimentResponse Source #

See: detectSentimentResponse smart constructor.

Instances

Eq DetectSentimentResponse Source # 
Data DetectSentimentResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DetectSentimentResponse -> c DetectSentimentResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DetectSentimentResponse #

toConstr :: DetectSentimentResponse -> Constr #

dataTypeOf :: DetectSentimentResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DetectSentimentResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DetectSentimentResponse) #

gmapT :: (forall b. Data b => b -> b) -> DetectSentimentResponse -> DetectSentimentResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DetectSentimentResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DetectSentimentResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> DetectSentimentResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DetectSentimentResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DetectSentimentResponse -> m DetectSentimentResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DetectSentimentResponse -> m DetectSentimentResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DetectSentimentResponse -> m DetectSentimentResponse #

Read DetectSentimentResponse Source # 
Show DetectSentimentResponse Source # 
Generic DetectSentimentResponse Source # 
NFData DetectSentimentResponse Source # 

Methods

rnf :: DetectSentimentResponse -> () #

type Rep DetectSentimentResponse Source # 
type Rep DetectSentimentResponse = D1 * (MetaData "DetectSentimentResponse" "Network.AWS.Comprehend.DetectSentiment" "amazonka-comprehend-1.6.0-7ky9kDszQAoCEHl21SoVpv" False) (C1 * (MetaCons "DetectSentimentResponse'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_dsrsSentiment") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe SentimentType))) ((:*:) * (S1 * (MetaSel (Just Symbol "_dsrsSentimentScore") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe SentimentScore))) (S1 * (MetaSel (Just Symbol "_dsrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int)))))

Response Lenses

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

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

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

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