Laravel package to perform sentiment analysis


I have just released a Laravel package that allows you to perform a sentiment analysis over an English sentence. This is basically a Laravel wrapper for phpInsight, written by JWHennessey.

Features overview

After registering the service provider and the alias in your app/config/app.php file, it will be super easy to use! Here is a little overview of the available functions:

SentimentAnalysis::isNegative("Weather today is rubbish"); // Returns true
SentimentAnalysis::decision("Weather today is rubbish"); // Returns 'negative'
SentimentAnalysis::score("Weather today is rubbish"); // Returns 0.5. We are pretty confident that it is a negative sentence

SentimentAnalysis::isPositive("Marie was enthusiastic about the upcoming trip. Her brother was also passionate about her leaving - he would finally have the house for himself."); // Returns true

Documentation and download

Of course the package is available via Composer. The full documentation can be found on GitHub :

Do not hesitate to open up an issue if something is not working as expected. Pull-requests are very welcome also!