Last active
December 3, 2019 11:30
-
-
Save RinatValiullov/8b3331d76253fa354aa7a899baf8da8c to your computer and use it in GitHub Desktop.
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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