1. Go to this page and download the library: Download kweaver00/watson_php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kweaver00 / watson_php example snippets
composer
composer
$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);