Skip to content
PHP Sentiment Analyzer is a lexicon and rule-based sentiment analysis tool that is used to understand sentiments in a sentence using VADER (Valence Aware Dictionary and sentiment Reasoner).
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fixed static method. Mar 11, 2019
.gitignore
LICENCE.txt Add files to repo Aug 29, 2018
README.md
composer.json Add files to repo Aug 29, 2018

README.md

PHP Sentiment Analyzer

PHP Sentiment Analyzer is a lexicon and rule-based sentiment analysis tool that is used to understand sentiments in a sentence using VADER (Valence Aware Dictionary and sentiment Reasoner).

GitHub license GitHub issues Twitter

Requirements

  • PHP 5.5 and above

Steps:

Install

Composer

Run the following to include this via Composer

composer require davmixcool/php-sentiment-analyzer

Usage


Use Sentiment\Analyzer;

$sentence = "David is smart, handsome, and funny.";
$analyzer = new Analyzer(); 
$result = $analyzer->getSentiment($sentence);

print_r($result);

##Output

['neg'=> 0.0, 'neu'=> 0.337, 'pos'=> 0.663, 'compound'=> 0.7096]

License

This package is licensed under the MIT license.

Reference

Hutto, C.J. & Gilbert, E.E. (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text. Eighth International Conference on Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.

You can’t perform that action at this time.