![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
wink-sentiment
Advanced tools
Accurate and fast sentiment scoring of phrases with emoticons :) & emojis 🎉
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:
Use npm to install:
npm install wink-sentiment --save
// 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.
Check out the wink sentiment API documentation to learn more.
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.
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.
wink-sentiment is copyright 2017-18 GRAYPE Systems Private Limited.
It is licensed under the terms of the MIT License.
FAQs
Accurate and fast sentiment scoring of phrases with emoticons :) & emojis 🎉
The npm package wink-sentiment receives a total of 311 weekly downloads. As such, wink-sentiment popularity was classified as not popular.
We found that wink-sentiment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.