Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
// index.js
var natural = require('natural');
var Analyzer = natural.SentimentAnalyzer;
var stemmer = natural.PorterStemmer;
var analyzer = new Analyzer("English", stemmer, "afinn");
// getSentiment ожидает массив строк
console.log(analyzer.getSentiment(["I", "don't", "want", "to", "play", "with", "you"]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment