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

License

Notifications You must be signed in to change notification settings

mkipness/php-sentiment-analyzer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%