composer require rxmg/php-sentiment
use PHPInsight\Sentiment;
#....
$analyzer = new Sentiment();
$analyzer->categorise($string); #return text category, positive, negative or neutral
$scores = $analyzer->score($string);
#Returns text scores, for example
#(
# [neg] => 0.865
# [neu] => 0.108
# [pos] => 0.027
# [neg_word] => ['horrible', 'boring', 'expensive']
#)
Run
composer demo
Run
composer generate-dictionaries
composer install
phpunit
Forked from https://github.com/JWHennessey/phpInsight