npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

wink-sentiment

v5.0.2

Published

Accurate and fast sentiment scoring of phrases with emoticons :) & emojis ๐ŸŽ‰

Downloads

1,395

Readme

wink-sentiment

Accurate & fast sentiment scoring of phrases with #hashtags, emoticons:) & emojis๐ŸŽ‰

Build Status Coverage Status dependencies Status devDependencies Status Gitter

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:

  1. Intelligent negation handling; for example, phrase "good product" will get a positive score whereas "not a good product" gets a negative score.
  2. Automatic detection and scoring of two-word phrases in a text; for example, "cool stuff", "well done", and "short sighted".
  3. Processes each emoji, emoticon and/or hashtag separately while scoring.
  4. Embeds a powerful tokenizer that returns the tokenized phrase.
  5. Returns the sentiment score and tokens. Each token contains a set of properties defining its sentiment, if any.
  6. 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

// Load wink-sentiment package.
var sentiment = require( 'wink-sentiment' );
// Just give any phrase and checkout the sentiment score. A positive score
// means a positive sentiment, whereas a negative score indicates a negative
// sentiment. Neutral sentiment is signalled by a near zero score.

// Positive sentiment text.
sentiment( 'Excited to be part of the @imascientist team:-)!' );
// -> { score: 5,
//      normalizedScore: 2.5,
//      tokenizedPhrase: [
//        { value: 'Excited', tag: 'word', score: 3 },
//        { value: 'to', tag: 'word' },
//        { value: 'be', tag: 'word' },
//        { value: 'part', tag: 'word' },
//        { value: 'of', tag: 'word' },
//        { value: 'the', tag: 'word' },
//        { value: '@imascientist', tag: 'mention' },
//        { value: 'team', tag: 'word' },
//        { value: ':-)', tag: 'emoticon', score: 2 },
//        { value: '!', tag: 'punctuation' }
//      ]
//    }

// Negative sentiment text.
console.log( sentiment( 'Not a good product :(' ) );
// -> { score: -5,
//      normalizedScore: -2.5,
//      tokenizedPhrase: [
//        { value: 'Not', tag: 'word' },
//        { value: 'a', tag: 'word', negation: true },
//        { value: 'good', tag: 'word', negation: true, score: -3 },
//        { value: 'product', tag: 'word' },
//        { value: ':(', tag: 'emoticon', score: -2 }
//      ]
//    }

// Neutral sentiment text.
console.log( sentiment( 'I will meet you tomorrow.' ) );
// -> { score: 0,
//      normalizedScore: 0,
//      tokenizedPhrase: [
//        { value: 'I', tag: 'word' },
//        { value: 'will', tag: 'word' },
//        { value: 'meet', tag: 'word' },
//        { value: 'you', tag: 'word' },
//        { value: 'tomorrow', tag: 'word' },
//        { value: '.', tag: 'punctuation' }
//      ]
//    }

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.