sa

sentiment-alyze

Text analysis tools for Node.js

Showing:

Popularity

Downloads/wk

0

GitHub Stars

2

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

2.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Build Status

sentiment-alyze

Node package for conducting textual analysis. The sentimentalyze method takes a string as its argument and returns a sentiment score calculated using AFINN-111. The termFrequency method also takes a string as its argument and returns an object with the count of words in that string. Filtering out English stop-words is optional.

Porter stemming algorithm reduces tokens to base, e.g. 'run', 'running', and 'runs' will all convert to 'run'.

Values of words in AFINN-111 range between -5 and +5.

Installation:

npm install --save sentiment-alyze

Usage:

var sA = require('sentiment-alyze'),
    string = 'This string is super awesome! I feel like running and shopping',
    sentimentScore = sA.sentimentalyze(string),
    termFrequency  = sA.termFrequency(string),
    termFrequencyNoStopWords = sA.termFrequency(string, {stopWords: 'no'}),
    termFrequencyPorterized = sA.termFrequency(string, {stopWords: 'no', stem: 'yes'}),
    phrases = [
               'Virgina Woolf wrote To the Lighthouse',
               'Virginia Woolf was an English author who lived in London.',
               'Virginia Woolf lived in London. London was important to her. '],
    tfIDF = sA.tfIDF(phrases);


    console.log('sentiment score ', sentimentScore, 'term frequency, all words ', termFrequency, 'term frequency, no stop words ', termFrequencyNoStopWords, 'porterized ', termFrequencyPorterized);
    console.log('term frequency-inverse document frequency ', tfIDF);

Tests

npm test;

Contributing

Fork, clone, lint, test, pull :-)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial