
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
sentiment-custom-lists
Advanced tools
AFINN-based sentiment analysis for Node.js. Prepared for different languages and context list
This project is a fork of thisandagain/sentiment. This project do the same as the original project and add support to use other AFINN like lists to do sentiment analysis
Sentiment is a Node.js module that uses the AFINN-111 wordlist to perform sentiment analysis on arbitrary blocks of input text. Sentiment provides serveral things:
npm install sentiment-custom-lists
var sentiment = require('sentiment-custom-lists');
var r1 = sentiment('Cats are stupid.');
console.dir(r1); // Score: -2, Comparative: -0.666
var r2 = sentiment('Cats are totally amazing!');
console.dir(r2); // Score: 4, Comparative: 1
("de_de" list currently not existing)
var sentiment = require('sentiment-custom-lists');
var r1 = sentiment('Katzen sind dumm.', 'de_de');
console.dir(r1); // Score: -2, Comparative: -0.666
You can append and/or overwrite values from AFINN by simply injecting key/value pairs into a sentiment method call:
var sentiment = require('sentiment');
var result = sentiment('Cats are totally amazing!', 'en_us' {
'cats': 5,
'amazing': 2
});
console.dir(result); // Score: 7, Comparative: 1.75
The primary motivation for designing sentiment
was performance. As such, it includes a benchmark script within the test directory that compares it against the Sentimental module which provides a nearly equivalent interface and approach. Based on these benchmarks, running on a MacBook Pro with Node 0.12.7, sentiment
is twice as fast as alternative implementations:
sentiment (Latest) x 544,714 ops/sec ±0.83% (99 runs sampled)
Sentimental (1.0.1) x 269,417 ops/sec ±1.06% (96 runs sampled)
To run the benchmarks yourself, simply:
make benchmark
npm test
FAQs
AFINN-based sentiment analysis for Node.js. Prepared for different languages and context list
The npm package sentiment-custom-lists receives a total of 0 weekly downloads. As such, sentiment-custom-lists popularity was classified as not popular.
We found that sentiment-custom-lists demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.