wink-sentiment
Accurate & fast sentiment scoring of phrases with #hashtags, emoticons:) & emojis🎉
Analyze sentiment of tweets, product reviews, social media content or any text using wink-sentiment
. It is based on AFINN and Emoji Sentiment Ranking; it's features include:
- Intelligent negation handling; for example, phrase "good product" will get a positive score whereas "not a good product" gets a negative score.
- Automatic detection and scoring of two-word phrases in a text; for example, "cool stuff", "well done", and "short sighted".
- Processes each emoji, emoticon and/or hashtag separately while scoring.
- Embeds a powerful tokenizer that returns the tokenized phrase.
- Returns the sentiment score and tokens. Each token contains a set of properties defining its sentiment, if any.
- Achieves accuracy of 77%, when validated using Amazon Product Review Sentiment Labelled Sentences Data Set at UCI Machine Learning Repository.
Installation
Use npm to install:
npm install wink-sentiment --save
Getting Started
var sentiment = require( 'wink-sentiment' );
sentiment( 'Excited to be part of the @imascientist team:-)!' );
console.log( sentiment( 'Not a good product :(' ) );
console.log( sentiment( 'I will meet you tomorrow.' ) );
Try experimenting with this example and more on Runkit in the browser.
Documentation
Check out the wink sentiment API documentation to learn more.
Need Help?
If you spot a bug and the same has not yet been reported, raise a new issue or consider fixing it and sending a pull request.
About wink
Wink is a family of open source packages for Statistical Analysis, Natural Language Processing and Machine Learning in NodeJS. The code is thoroughly documented for easy human comprehension and has a test coverage of ~100% for reliability to build production grade solutions.
Copyright & License
wink-sentiment is copyright 2017-18 GRAYPE Systems Private Limited.
It is licensed under the terms of the MIT License.