2017 © Pedro Peláez
 

library watson_php

A PHP SDK for using IBM Watson

image

kweaver00/watson_php

A PHP SDK for using IBM Watson

  • Monday, April 10, 2017
  • by kweaver00
  • Repository
  • 1 Watchers
  • 5 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

ibm-watson-php-sdk

Installing Using Composer

composer require kweaver00/watson_php

or, (*1)

composer require kweaver00/watson_php dev-master

Supported Services

Natural Language Classifier, (*2)

Retrieve and Rank, (*3)

Document Conversion, (*4)

Natural Language Classifier

Creating A New Object

$naturalLangObj = new \Kweaver\Watson\NaturalLanguageClassifier();

API Methods

Create classifier - Sends data to create and train a classifier and returns information about the new classifier., (*5)

List classifiers - Retrieves the list of classifiers for the service instance. Returns an empty array if no classifiers are available., (*6)

Get information about a classifier - Returns status and other information about a classifier, (*7)

Delete classifier - Deletes a classifier., (*8)

Classify - Returns label information for the input. The status must be "Available" before you can classify calls. Use the Get information about a classifier method to retrieve the status., (*9)

Example

require_once "/vendor/autoload.php";

$naturalLangObj = new \Kweaver\Watson\NaturalLanguageClassifier();
$naturalLangObj->setServiceCredentials("YOUR_WATSON_SERVICE_CREDENTIALS_USER_NAME","YOUR_WATSON_SERVICE_CREDENTIALS_PASSWORD");

$localFilePathForTrainingMetaDataJSON = realpath("./new_training_data_meta_data.json");
$localFilePathForTrainingData = realpath("./weather_data_train.csv");

//Creating a new classifier
$response = $naturalLangObj->create($localFilePathForTrainingData,$localFilePathForTrainingMetaDataJSON);

Retrieve and Rank

Document Conversion

Creating A New Object

$documentConversionObj = new \Kweaver\Watson\DocumentConversion();

API Methods

Convert a document - Converts a document to answer units, HTML or text. This method accepts a multipart/form-data request. Upload the document as the "file" form part and the configuration as the "config" form part., (*10)

Example

require_once "/vendor/autoload.php";

$documentConversionObj = new \Kweaver\Watson\DocumentConversion();
$documentConversionObj->setServiceCredentials("YOUR_USERNAME_FOR_THE_DOC_CONVERSION_SERVICE","YOUR_PASSWORD");

$configFilePath = realpath('./config.json');
$uploadedFilePath = realpath('./sample.pdf');

$version = date('Y-m-d');

$result = $documentConversionObj->convert($configFilePath, $uploadedFilePath, $version);

The Versions

10/04 2017

dev-master

9999999-dev https://github.com/kweaver00/unofficial-ibm-watson-php-sdk

A PHP SDK for using IBM Watson

  Sources   Download

Apache 2.0

The Requires

 

The Development Requires

php ibm ibm watson

22/02 2017

dev-dev-discovery

dev-dev-discovery https://github.com/kweaver00/unofficial-ibm-watson-php-sdk

A PHP SDK for using IBM Watson

  Sources   Download

Apache 2.0

The Requires

 

The Development Requires

php ibm ibm watson

22/02 2017

v1.0

1.0.0.0 https://github.com/kweaver00/unofficial-ibm-watson-php-sdk

A PHP SDK for using IBM Watson

  Sources   Download

Apache 2.0

The Requires

 

The Development Requires

php ibm ibm watson