Text and emojis sentiment analysis for Node.js
Multilanguage, only full support for english and french (PR contributions are welcome)
He has full support on emoji analysis.
Language detection if not provided at call.
Sentiment analysis is suitable at a sentence level, for long strings, please tokenize sentences and use sentiment on every chunk.
This project is a fork of the original sentiment project: https://github.com/thisandagain/sentiment
npm install node-sentiment --save
// Require the node-sentiment modulevar sentiment = ;// Use the module to get sentiment from texts.// Vote: 'negative'consoledir;// Vote: 'negative' and english detectedconsoledir;// Vote: 'positive', english detected and negation detectedconsoledir;// Vote: 'positive'consoledir;// Vote: 'negative'consoledir;// Sample response for "Seems somebody had a good meal! @wildelifeanimal #lion #safari #cats #wildlife #Africa #adventure #offroad ♥"score: 8comparative: 05vote: 'positive'tokens:'seems''somebody''had''a''good''meal''@wildelifeanimal''lion''safari''cats''wildlife''africa''adventure''offroad''httpstco6cx7halryy''♥'words: '♥' 'adventure' 'good'positive: '♥' 'adventure' 'good'negative:language: 'en'
You can also play with node-sentiment in a terminal.
node cli.js "Cats are not so cool..."
06/09/2018 Patch 0.0.7
package.json update to remove mocha from production dependencies npm lock file added
18/07/2017 Patch 0.0.6
Fix on tokenize method and integration test added on it
18/07/2017 Patch 0.0.5
Whole code review Basic CLI interface added and project renamed to node-sentiment for npm package
17/07/2017 Patch 0.0.4
Negation detection fix Language detection feature POC added