Socket
Socket
Sign inDemoInstall

emoji-sentiment

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    emoji-sentiment

Emoji sentiment data


Version published
Weekly downloads
2
decreased by-89.47%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 27 Mar 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc