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

emoji-sentiment

v3.0.2

Published

Emoji sentiment data

Downloads

108

Readme

Emoji Sentiment

Emoji sentiment data

  • lightweight, easy to use JSON data with a minimalistic API
  • based on the work of Kralj Novak, Petra; Smailović, Jasmina; Sluban, Borut and Mozetič, Igor, 2015, Emoji Sentiment Ranking 1.0, Slovenian language resource repository CLARIN.SI, http://hdl.handle.net/11356/1048.
  • they engaged 83 human annotators to label over 1.6 million tweets in 13 european languages by sentiment polarity (negative, neutral or positive) while about 4% of the annotated tweets contained emoji
  • this module provides transformed JSON data based on the original CSV data and derived data calculated in compliance with the original paper

Have a look at this table to see an example of what data this library provides.

API

Requiring/importing emoji-sentiment gives you the following data structure to work with:

[..., { /* emoji sentiment datum */ }, ...]

Array of emoji sentiment data.

Example of an emoji sentiment datum:

[
  ...
  {
    // original properties:
    "sequence": "1F602",
    "occurrences": 14622,
    "negative": 3614,
    "neutral": 4163,
    "positive": 6845,
    // derived properties:
    "pNegative": 0.24717948717948718,
    "pNeutral": 0.2847179487179487,
    "pPositive": 0.4681025641025641,
    "score": 0.22092307692307694,
    "sem": 0.006751317877016391
  },
  ...
]

Original properties are included in the JSON file whereas derived properties are being calculated on demand when the module is being required/imported.

Properties of an emoji sentiment datum explained:

  • sequence (original)

    normalized code point sequence (sequence without any variation selector or modifier applied) e.g. 1F602; use it for mapping the sentiment datum to a specific (emoji) unicode character or connecting it with further meta data (e.g. unicode-emoji-data, unicode-emoji-annotations or emoji-datasource)

  • occurrences (original)

    absolute number of occurrences of the (emoji) unicode character in tweets

  • negative (original)

    absolute number of occurrences of the (emoji) unicode character in tweets labeled negative

  • neutral (original)

    absolute number of occurrences of the (emoji) unicode character in tweets labeled neutral

  • positive (original)

    absolute number of occurrences of the (emoji) unicode character in tweets labeled positive

  • pNegative (derived)

    relative negativity component of the sentiment distribution for those tweets associated with the (emoji) unicode character, ranging from 0 to 1

  • pNeutral (derived)

    relative neutrality component of the sentiment distribution for those tweets associated with the (emoji) unicode character, ranging from 0 to 1

  • pPositive (derived)

    relative positivity component of the sentiment distribution for those tweets associated with the (emoji) unicode character, ranging from 0 to 1

  • score (derived)

    resulting sentiment score of the (emoji) unicode character, ranging from -1 to +1, calculated as the mean of the discrete sentiment distribution of negative (-1), neutral (0) and positive (+1)

  • sem (derived)

    precalculated Standard Error Mean for further deriving the confidence interval, e.g. for 95%: [score − 1.96 * sem, score + 1.96 * sem]

The sum of negative, neutral and positive is occurrences.

The sum of pNegative, pNeutral and pPositive is 1.

Usage

CommonJS

const emojiSentiment = require('emoji-sentiment');

ES6/babel

import emojiSentiment from 'emoji-sentiment';

Install

npm install emoji-sentiment

License

MIT

Development

Status

Travis Codecov