Sentiment Analysis with Negation Handling
const winkNLP = require( 'wink-nlp' );
const its = require( 'wink-nlp/src/its.js' );
// Use web model for RunKit.
const model = require( 'wink-eng-lite-web-model' );
const nlp = winkNLP( model );
const text = 'the movie received critical acclaim. the movie did not attain critical acclaim.';
const doc = nlp.readDoc( text );
// Print each sentiment of each sentence.
console.log( doc.sentences().out( its.sentiment ) );
no comments