Skip to content

Instantly share code, notes, and snippets.

@dkhmelenko
Created September 25, 2022 12:08
Show Gist options
  • Save dkhmelenko/af89668c45d5e20dace4f4cee0a2ebdc to your computer and use it in GitHub Desktop.
Save dkhmelenko/af89668c45d5e20dace4f4cee0a2ebdc to your computer and use it in GitHub Desktop.
import boto3
review_text = 'The service was terrible! The food was cold and the staff was rude. Def not recommended'
client = boto3.client('comprehend')
response = client.detect_sentiment(Text=review_text, LanguageCode="en")
print(response['Sentiment'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment