Could you advise some php5 library wich i can teach to guess emotions in texts? (happy comment, angry comment, etc)
For example i need to check in my code if comment “I love your product!” is positive or negative and set appropriate status for this comment in my DB.
I found one but it’s too old and hardcoded so i hope on your help.
I know of EmoTE, it’s a (partial) PHP port of Synesketch which seems to be quite good.
Beware that for languages other than English you need to get your own emotive text corpus.
There are also some uClassify classifiers, such as Mood and Sentiment (which seems to be the one you’re looking for) but they work by training bayesian networks and they don’t seem to provide the kind of detailed data that EmoTE provides. Here are some tests using the comments on this question:
Input (uClassify – Sentiment Classifier):
Output:
Input (uClassify – Sentiment Classifier):
Output:
Input (uClassify – Sentiment Classifier):
Output:
Input (uClassify – Sentiment Classifier):
Output:
Seems to do the job. Also, uClassify has an API and self-hosted solutions that you can use to classify and train existing classifiers with your own data, which might be useful depending on your exact needs.