Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Inspects text and returns an inference of the prevailing sentiment (POSITIVE
, NEUTRAL
, MIXED
, or NEGATIVE
).
- detectSentiment :: Text -> LanguageCode -> DetectSentiment
- data DetectSentiment
- dsText :: Lens' DetectSentiment Text
- dsLanguageCode :: Lens' DetectSentiment LanguageCode
- detectSentimentResponse :: Int -> DetectSentimentResponse
- data DetectSentimentResponse
- dsrsSentiment :: Lens' DetectSentimentResponse (Maybe SentimentType)
- dsrsSentimentScore :: Lens' DetectSentimentResponse (Maybe SentimentScore)
- dsrsResponseStatus :: Lens' DetectSentimentResponse Int
Creating a Request
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 andUnsupportedLanguageException
. For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.
data DetectSentiment Source #
See: detectSentiment
smart constructor.
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.
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.
dsrsResponseStatus :: Lens' DetectSentimentResponse Int Source #
- - | The response status code.