Skip to content

winkjs/showcase-hashtag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winkNLP Sentiment

built with winkNLP Gitter Follow on Twitter

Sentiment Analysis of Twitter Hashtag

This demo takes a Twitter hashtag and calculates the sentiments of the top tweets on that hashtag. It does this by using the out method in winkNLP. It loads the tweet by using readDoc and then outputs its.sentiment.

How to build this

const winkNLP = require('wink-nlp');
const its = require( 'wink-nlp/src/its.js' );
const as = require( 'wink-nlp/src/as.js' );
const model = require('wink-eng-lite-model');
const nlp = winkNLP(model);

var sentiment = [];
var tweets = [
  'I am so happy!',
  'I am so sad'
];

tweets.forEach((t) => {
    var tweetSentiment = nlp.readDoc(t).out(its.sentiment);
    sentiment.push({
        tweet: t,
        sentiment: tweetSentiment
    });
});

console.log(sentiment);

About

#️⃣ Sentiment analysis for hashtags on Twitter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published