trump2cash icon indicating copy to clipboard operation
trump2cash copied to clipboard

Better sentiment analysis

Open maxbbraun opened this issue 7 years ago • 7 comments

The sentiment analysis sometimes gets it wrong. It also assigns the tweet's overall sentiment to all companies, which may not be correct in some cases.

One idea would be to try targeted sentiment analysis, e.g. using the IBM Watson AlchemyLanguage API.

maxbbraun avatar Jan 30 '17 03:01 maxbbraun

I've actually used Watson's API and would be happy to take a crack at it. Not sure at what pace that would be, but I'd be up for it

flaw600 avatar Feb 11 '17 00:02 flaw600

If you don't mind spawning a java jar and communicating with it over sockets, I worked on a project that did sentiment analysis on the 2012 presidential debate captions. You can see the implementation here (JS): https://github.com/sosolimited/recon_backend/blob/master/named-entity/index.js#L36

Not sure if it'll be helpful, but might be a little easier to start with (but certainly not as powerful as Watson).

tbranyen avatar Feb 11 '17 02:02 tbranyen

Ok, I tried both the Watson sentiment analysis and the targeted sentiment APIs.

Both perform worse than the current implementation using the GCNL APIs.

The targeted one is wrong a lot, I suspect because it just doesn't have enough words in a short tweet to work well. The non-targeted one is frequently neutral where GCNL detects the correct sentiment.

maxbbraun avatar Feb 11 '17 22:02 maxbbraun

@maxbbraun can you share your test set of tweets and if possible your Watson implementation? My admittedly very limited testing is showing both types of sentiment being accurate

flaw600 avatar Feb 12 '17 00:02 flaw600

@flaw600 Make the changes, run the benchmark, then look at the diff.

maxbbraun avatar Feb 12 '17 00:02 maxbbraun

Interesting. You're correct of course. In my limited testing using tweets not used in the benchmark I noticed Watson performing better (meaning more accurately than on this set, I didn't compare against GCNL) on his most recent tweets but you're right to stay on GCNL for now. Very intriguing

flaw600 avatar Feb 12 '17 02:02 flaw600

For sentiment analyst, since you are using python, neural network with LSTM could be a solution Something like this : https://github.com/bentrevett/pytorch-sentiment-analysis

labidus avatar Jul 03 '20 02:07 labidus