Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Inspects text and returns an inference of the prevailing sentiment
(POSITIVE
, NEUTRAL
, MIXED
, or NEGATIVE
).
Synopsis
- data DetectSentiment = DetectSentiment' {}
- newDetectSentiment :: Text -> LanguageCode -> DetectSentiment
- detectSentiment_text :: Lens' DetectSentiment Text
- detectSentiment_languageCode :: Lens' DetectSentiment LanguageCode
- data DetectSentimentResponse = DetectSentimentResponse' {}
- newDetectSentimentResponse :: Int -> DetectSentimentResponse
- detectSentimentResponse_sentiment :: Lens' DetectSentimentResponse (Maybe SentimentType)
- detectSentimentResponse_sentimentScore :: Lens' DetectSentimentResponse (Maybe SentimentScore)
- detectSentimentResponse_httpStatus :: Lens' DetectSentimentResponse Int
Creating a Request
data DetectSentiment Source #
See: newDetectSentiment
smart constructor.
DetectSentiment' | |
|
Instances
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.
DetectSentimentResponse' | |
|
Instances
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.
detectSentimentResponse_httpStatus :: Lens' DetectSentimentResponse Int Source #
The response's http status code.