Skip to content

Instantly share code, notes, and snippets.

@LucasLeRay
Created May 12, 2020 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucasLeRay/db20c56e2fd9d0d8c59c0fb0524bf03a to your computer and use it in GitHub Desktop.
Save LucasLeRay/db20c56e2fd9d0d8c59c0fb0524bf03a to your computer and use it in GitHub Desktop.
const AWS = require("aws-sdk"); // import AWS SDK
const comprehend = new AWS.Comprehend({
apiVersion: "2017-11-27",
region: "eu-west-1",
}); // setup Comprehend
comprehend.detectSentiment(
{
Text: "I love apples", // The text to analyze
LanguageCode: "en", // The language of the text
},
function (err, data) {
console.log(data); // the sentiments of the author! 🎉🎉🎉
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment