PHPackages                             choccybiccy/sentiment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. choccybiccy/sentiment

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

choccybiccy/sentiment
=====================

Sentiment analysis using the DatumBox API

1.0.0(11y ago)027MITPHP

Since Apr 8Pushed 11y ago1 watchersCompare

[ Source](https://github.com/choccybiccy/sentiment)[ Packagist](https://packagist.org/packages/choccybiccy/sentiment)[ RSS](/packages/choccybiccy-sentiment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Sentiment Analysis
==================

[](#sentiment-analysis)

[![Build Status](https://camo.githubusercontent.com/71a29f6360129b9dd071c1e695d0dea7298e7e4e97f71eedf13889c2a71d7e7f/68747470733a2f2f7472617669732d63692e6f72672f63686f63637962696363792f73656e74696d656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/choccybiccy/sentiment) [![Latest Stable Version](https://camo.githubusercontent.com/b25f8513a6a1b6f228f6222b1012e67369cd0dd9e35786eceac22e2a69bd3f0f/68747470733a2f2f706f7365722e707567782e6f72672f63686f63637962696363792f73656e74696d656e742f762f737461626c652e737667)](https://packagist.org/packages/choccybiccy/sentiment) [![License](https://camo.githubusercontent.com/717ba9d6fa16c0fd79d1fb3c3f76622f94008ba93c9525f040a40e7f0d35bd72/68747470733a2f2f706f7365722e707567782e6f72672f63686f63637962696363792f73656e74696d656e742f6c6963656e73652e737667)](https://packagist.org/packages/choccybiccy/sentiment) [![SensioLabsInsight](https://camo.githubusercontent.com/5e0308442b04074ca9a285842d42a853356a185b5b168ddc00491b602ff6fd6d/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61646163336538332d616636322d346538652d623563642d3465396435333934663538392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/adac3e83-af62-4e8e-b5cd-4e9d5394f589)

Various analysis tools using the Datumbox API.

Prerequisites
-------------

[](#prerequisites)

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

Installation
------------

[](#installation)

Installation is a cinch with composer..

```
composer require choccybiccy/sentiment
```

Usage
-----

[](#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

[](#available-endpoints)

ServiceConstantClassMethodSentiment`\Choccybiccy\Sentiment\Factory::ENDPOINT_ANALYSIS_SENTIMENT``Choccybiccy\Sentiment\Analysis\Sentiment``analyse(str $text)`Subject analysis`\Choccybiccy\Sentiment\Factory::ENDPOINT_ANALYSIS_SUBJECTIVITY``Choccybiccy\Sentiment\Analysis\Subjectivity``analyse(str $text)`Readability assessment`\Choccybiccy\Sentiment\Factory::ENDPOINT_ASSESSMENT_READABILITY``Choccybiccy\Sentiment\Assessment\Readability``assess(str $text)`Topic classification`\Choccybiccy\Sentiment\Factory::ENDPOINT_CLASSIFICATION_TOPIC``Choccybiccy\Sentiment\Classification\Topic``classify(str $text)`Similarity`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_SIMILARITY``Choccybiccy\Sentiment\Comparison\Similarity``compare(str $original, str $copy)`Adult content detection`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_ADULT``Choccybiccy\Sentiment\Detection\Adult``detect(str $text)`Commercial detection`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_COMMERCIAL``Choccybiccy\Sentiment\Detection\Commercial``detect(str $text)`Educational detection`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_EDUCATIONAL``Choccybiccy\Sentiment\Detection\Educational``detect(str $text)`Gender detection`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_GENDER``Choccybiccy\Sentiment\Detection\Gender``detect(str $text)`Language detection`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_LANGUAGE``Choccybiccy\Sentiment\Detection\Language``detect(str $text)`Spam detection`\Choccybiccy\Sentiment\Factory::ENDPOINT_COMPARISON_SPAM``Choccybiccy\Sentiment\Detection\Spam``detect(str $text)`Keyword extraction`\Choccybiccy\Sentiment\Factory::ENDPOINT_EXTRACTION_KEYWORD``Choccybiccy\Sentiment\Extraction\Keyword``extract(str $text)`Text extraction`\Choccybiccy\Sentiment\Factory::ENDPOINT_EXTRACTION_TEXT``Choccybiccy\Sentiment\Extraction\Text``extract(str $text)`Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

Authors
-------

[](#authors)

Written and maintained by Martin Hughes.

Thanks
------

[](#thanks)

Thanks to [Datumbox](http://www.datumbox.com/) for providing the web services.

Copyright &amp; licensing
-------------------------

[](#copyright--licensing)

See [LICENSE](LICENSE)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4058d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b36011a36520abc06a7bcec01478a3e4c66cdafd8c8e6ecec44bade9e25d11ef?d=identicon)[martinph](/maintainers/martinph)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/choccybiccy-sentiment/health.svg)

```
[![Health](https://phpackages.com/badges/choccybiccy-sentiment/health.svg)](https://phpackages.com/packages/choccybiccy-sentiment)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
