diff --git a/NLP with JavaScript/index.js b/NLP with JavaScript/index.js new file mode 100644 index 0000000..71b1ad5 --- /dev/null +++ b/NLP with JavaScript/index.js @@ -0,0 +1,13 @@ +var Sentiment = require('sentiment'); +var sentiment = new Sentiment(); + +var docx = sentiment.analyze("I like apples"); +console.log(docx); + +// Applying to An Array +var mydocx = ["I love apples","I don't eat pepper","the movie was very nice","this book is the best"] + +mydocx.forEach(function(s){ + console.log(sentiment.analyze(s)); +}) +