PHPackages                             data2insights/data2insights-php - 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. [API Development](/categories/api)
4. /
5. data2insights/data2insights-php

ActiveLibrary[API Development](/categories/api)

data2insights/data2insights-php
===============================

Official PHP client for the Data2Insights Cognitive services.

05PHP

Since Nov 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/AadhyaAnalyticsInc/D2I_Python)[ Packagist](https://packagist.org/packages/data2insights/data2insights-php)[ RSS](/packages/data2insights-data2insights-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Data2Insights-php
=================

[](#data2insights-php)

Official PHP client for the Data2Insights API. Build and consume machine learning models for language processing from your PHP apps.

Autoload
--------

[](#autoload)

The first step to use `Data2Insights-php` is to download composer:

```
$ curl -s http://getcomposer.org/installer | php
```

Then we have to install our dependencies using:

```
$ php composer.phar install
```

Now we can use autoloader from Composer by:

```
{
    "require": {
        "Data2Insights/Data2insights-php": "~0.1"
    }
}
```

Or, if you don't want to use composer, clone the code and include this line of code:

```
require 'autoload.php';

```

Usage examples
--------------

[](#usage-examples)

Here are some examples of how to use Text Models:

```
require 'autoload.php';

// Use the Account Id,API key,Email Id from your account
$d2i = new Data2Insights\Client('','','');

// Call Sentiment Model
$d2i->text->sentiment('');
// Call Emotion Model
$d2i->text->emotion('');
// Call Topic Model
$d2i->text->topic('');
// Call Spam Model
$d2i->text->spam('');
// Call Gender Model
$d2i->text->gender('');
// Call Age Model
$d2i->text->age('');
// Call TweetSentiment Model
$d2i->text->tweetsentiment('');
// Call Personalitytraits Model
$d2i->text->personalitytraits('');
// Call Entity Model
$d2i->text->entity('');
// Call Keyword Model
$d2i->text->keyword('');
// Call TweetEntity Model
$d2i->text->tweetentity('');
// Call URLEtraction Model
$d2i->text->urlextraction('
