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

@stdlib/datasets-afinn-96

v0.2.2

Published

A list of English words rated for valence.

Downloads

42

Readme

AFINN-96

NPM version Build Status Coverage Status

A list of English words rated for valence.

Installation

npm install @stdlib/datasets-afinn-96

Usage

var afinn96 = require( '@stdlib/datasets-afinn-96' );

afinn96()

Returns a list of 1468 unique English words (and phrases) rated for valence. Negative words have a negative valence ([-5,0)). Positive words have a positive valence ((0,5]). Neutral words have a valence of 0.

var words = afinn96();
/* returns
    [
        ['abandon',-2],
        ['abandons',-2],
        ['abandoned',-2],
        ['absentee',-1],
        ['absentees',-1],
        ['aboard',1],
        ['abducted',-2],
        ['abduction',-2],
        ['abductions',-2],
        ['abuse',-3],
        ['abused',-3],
        ...
    ]
*/

Notes

  • The list is an earlier version of AFINN-111.
  • The list contains duplicated words.
  • The list includes misspelled words. Their presence is intentional, as such misspellings frequently occur in social media content.
  • All words are lowercase.
  • Some "words" are phrases; e.g., cashing in, cool stuff.
  • Words may contain apostrophes; e.g., can't stand.
  • Words may contain dashes; e.g., cover-up, made-up.

Examples

var afinn96 = require( '@stdlib/datasets-afinn-96' );

var words;
var dict;
var len;
var i;

words = afinn96();

// Convert to a dictionary...
len = words.length;
dict = {};
for ( i = 0; i < len; i++ ) {
    dict[ words[i][0] ] = words[i][1];
}
console.dir( dict );

References

  • Nielsen, Finn Årup. 2011. "A new ANEW: Evaluation of a word list for sentiment analysis in microblogs." In Proceedings of the ESWC2011 Workshop on 'Making Sense of Microposts': Big things come in small packages., 718:93–98. CEUR Workshop Proceedings. http://ceur-ws.org/Vol-718/paper_16.pdf.
  • Hansen, Lars Kai, Adam Arvidsson, Finn Årup Nielsen, Elanor Colleoni, and Michael Etter. 2011. "Good Friends, Bad News - Affect and Virality in Twitter." In Future Information Technology: 6th International Conference, FutureTech 2011, Loutraki, Greece, June 28-30, 2011, Proceedings, Part II, edited by James J. Park, Laurence T. Yang, and Changhoon Lee, 34–43. Berlin, Heidelberg: Springer Berlin Heidelberg. doi:10.1007/978-3-642-22309-9_5.

License

The data files (databases) are licensed under an Open Data Commons Attribution 1.0 License and their contents are licensed under a Creative Commons Attribution 4.0 International Public License. The original dataset is attributed to Finn Årup Nielsen and can be found here. The software is licensed under Apache License, Version 2.0.

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


Copyright

Copyright © 2016-2024. The Stdlib Authors.