Say you want to find out if a user generated text is happy, sad, upbeat or hateful. Not so easy is it? We were given this task as a part of a recent project. And to make things even more challenging we needed to do this in both Swedish and English.
After a bit of research I found a very interesting API that pretty much does this – SAPLO. Using their API we can create reference groups of texts, and compare user generated texts with these groups.
Say we create two groups; Positive and Negative.
We then measure each user generated text towards these groups, and get a sentiment back. For instance:
Jag har tråkigt (I’m bored):
[Negative] => 0.14
[Positive] => 0
Fisk är gott (Fish tastes good):
[Negative] => 0.22
[Positive] => 0.28
Många tycker det är tråkigt att resa, men inte jag (Many people things that it’s tedious to travel, but I don’t):
[Negative] => 0.40
[Positive] => 0.46
SAPLO works great on both English and Swedish.