ricasolucoes/phpinsight

Sentiment analysis tool for PHP

v3.0.0 2020-09-19 07:08 UTC

This package is not auto-updated.

Last update: 2021-10-17 11:39:00 UTC


README

Installation

composer require ricasolucoes/php-insight

Usage

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
#)

Demo

Run

composer demo

Generate dictionaries

Run

composer generate-dictionaries

Tests

Install and run phpunit in project dir