choccybiccy/sentiment

Sentiment analysis using the DatumBox API

1.0.0 2015-04-08 11:48 UTC

This package is auto-updated.

Last update: 2024-12-23 12:55:42 UTC


README

Build Status Latest Stable Version License SensioLabsInsight

Various analysis tools using the Datumbox API.

Prerequisites

As this API uses web services from Datumbox you'll need to register an account with them to obtain an API key.

http://www.datumbox.com/users/register/

Installation

Installation is a cinch with composer..

composer require choccybiccy/sentiment

Usage

use Choccybiccy\Sentiment\Factory;

$factory = new Factory();

$sentiment = $factory->create(
    Factory::ENDPOINT_ANALYSIS_SENTIMENT,
    "MyApiKey"
);

$result = $sentiment->analyse("I don't like her, I love her!");
echo "The sentiment is " . $result->getResult(); # Will return: The sentiment is positive

Available endpoints

Testing

vendor/bin/phpunit

Authors

Written and maintained by Martin Hughes.

Thanks

Thanks to Datumbox for providing the web services.

Copyright & licensing

See LICENSE