What is sentiment analysis
Sentiment analysis is extracting the subjective information from the text which is useful for your business.
Example – If you are running an E-commerce business and you want to know about the ratings of your products displayed on your website, you have feedback of people but product is not being rated.Using sentiment analysis you can extract scores from given feedback which will help you to auto-rate your product. Isn’t it interesting ?
How we can do sentiment analysis in NodeJs
Install sentiment package using npm
npm install sentiment
Use sentiment package to find the scores
var Sentiment = require('sentiment'); var sentiment = new Sentiment(); var result = sentiment.analyze('Cats are stupid.'); console.dir(result); // Score: -2, Comparative: -0.666
and that’s it, you can use resulted scores to auto rate your products, services etc.
Happy Coding 🙂