Giter Club home page Giter Club logo

retext-sentiment's People

Contributors

greenkeeperio-bot avatar omarchehab98 avatar wooorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

retext-sentiment's Issues

Adding new negations

Originally, it is:

 function isNegation(node) {
     var value;

     value = node.toString().toLowerCase();

     if (
         value === 'not' ||
         value === 'neither' ||
         value === 'nor' ||
         /n['’]t/.test(value)
     ) {
         return true;
     }

     return false;
 }

I found more negations...
for example, "please improve" is negative...
and tried to improve...

 function isNegation(node) {
     var value;

     value = node.toString().toLowerCase();

     if (
         value === 'not' ||
         value === 'neither' ||
         value === 'nor' ||
         value === 'never' ||
         value === 'nobody' ||
         value === 'none' ||
         value === 'nothing' ||
         value === 'nowhere' ||
         value === 'few' ||
         value === 'hardly' ||
         value === 'little' ||
         value === 'rarely' ||
         value === 'scarcely' ||
         value === 'seldom' ||
         value === 'please' ||
         /n['’]t/.test(value)
     ) {
         return true;
     }

     return false;
 }

But failed. The result for
"not good" = -3
"never good" = +3 (which should be -3)

Anything missed out?

Consider double negation

The text "This product is not bad at all." will be classified as bad (based on the demo) whereas the meaning is actually good.

I am not sure how hard it would be to implement negation though, but I believe this piece of text is not uncommon so the case should be handled.

Adding to the sentiment list

Hi, do I have to make a pull request to add to the sentiment data list?

New word is "ultimate".

Thanks
Sharry

Polarity

I am working on a twitter-sentiment project and I have been struggling to attach the polarity of each tweet to my data. There must be something I am not understanding. Polarity is not being attached, instead 'data.sentiment' returns undefined. Thanks for all your help. Here is my code:

tweet.stream('statuses/filter', { track: 'dallas' }, function(stream) {
stream.on('data', function (data) {
//run sentiment and attach to data
retext().use(sentiment).use(function () {
return function (cst) {
console.log(inspect(cst));
};
}).process(data.text);
data.sentiment = data.polarity;
io.sockets.emit('tweet', data);
//console.log(data.user.location);
//console.log(data.tweet.location);
console.log(data);

});
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.