PHP Classes

PHP IBM Watson: Call IBM Watson API services

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 271 All time: 7,712 This week: 524Up
Version License PHP version Categories
ibm-watson 1.0.0Custom (specified...5PHP 5, Web services, Artificial intel...
Description 

Author

This package can call IBM Watson API services.

It sends HTTP requests to several types of APIs of IBM Watson.

Currently it provides classes to access APIs for natural language understanding, language translation, etc..

Innovation Award
PHP Programming Innovation award nominee
May 2017
Number 7
IBM Watson is a cloud based infrastructure that provides artificial intelligence software services.

This package can call IBM Watson API to benefit from several types of their artificial intelligence services.

Manuel Lemos
Picture of MERAJ AHMAD SIDDIQUI
  Performance   Level  
Name: MERAJ AHMAD SIDDIQUI is available for providing paid consulting. Contact MERAJ AHMAD SIDDIQUI .
Classes: 2 packages by
Country: India India
Age: 29
All time rank: 3657249 in India India
Week rank: 215 Up16 in India India Up
Innovation award
Innovation award
Nominee: 2x

Example

<?php

include dirname(dirname(__DIR__)) . "/vendor/autoload.php";
//Provide jspn file to config
use IBMWatson\Config;
//json file containing url, username and password for the service
$api_credintial_json_file = dirname(dirname(__DIR__)) . "/config/language_translator.json";
$config = Config::init($api_credintial_json_file);

use
IBMWatson\Language\LanguageTranslator\Translator;
/**
 * Providing config to Translator
 * @var Translator
 */
$translator = new Translator($config);

$language_supported = $translator->getSupportedLanguage();

$language_set = [
   
"from" => "en",
   
"to" => "es",
];
$translator->setLanguage($language_set);

$text = "PHP Developer, I code to change the world's work flow";

$translated = $translator->translate($text);
//all models
$models = $translator->listModels();
//conversationa Models
$conver_models = $translator->listConversationalModels();

//Creating new model
/**
 * Creating a new model requires a glossary to used by watson
 * a tmx file (Translation Memory Echange ) by which the translation will work
 * a sample tms file is provided
 */

$glossary_tmx = "custom_model.tmx";
$new_model_details = [
   
"name" => "custom-englis-to-bhojpuri",
   
"base_model_id" => "en-es",
   
"glossary" => $glossary_tmx,
];

$new_model = $translator->createModel($new_model_details);
var_dump($new_model);


  Files folder image Files (23)  
File Role Description
Files folder imageconfig (1 file)
Files folder imageexamples (2 directories)
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file License.md Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files (23)  /  config  
File Role Description
  Accessible without login Plain text file credential.json Data Auxiliary data

  Files folder image Files (23)  /  examples  
File Role Description
Files folder imagelanguage (4 files)
Files folder imageVoice (1 file)

  Files folder image Files (23)  /  examples  /  language  
File Role Description
  Accessible without login Plain text file Conversation.php Example Example script
  Accessible without login Plain text file custom_model.tmx Data Auxiliary data
  Accessible without login Plain text file LanguageTranslator.php Example Example script
  Accessible without login Plain text file LanguageUnderstanding.php Example Example script

  Files folder image Files (23)  /  examples  /  Voice  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files (23)  /  src  
File Role Description
Files folder imageIBMWatson (2 files, 4 directories)

  Files folder image Files (23)  /  src  /  IBMWatson  
File Role Description
Files folder imageDataInsights (1 directory)
Files folder imageLanguage (4 directories)
Files folder imageSpeech (1 directory)
Files folder imageVision (1 directory)
  Plain text file Config.php Class Class source
  Plain text file Platform.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  DataInsights  
File Role Description
Files folder imageDiscovery (1 file)

  Files folder image Files (23)  /  src  /  IBMWatson  /  DataInsights  /  Discovery  
File Role Description
  Plain text file Version.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  Language  
File Role Description
Files folder imageConversation (4 files)
Files folder imageLanguageTranslator (1 file)
Files folder imageNatural (1 directory)
Files folder imagePersonalityInsights (1 file)

  Files folder image Files (23)  /  src  /  IBMWatson  /  Language  /  Conversation  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file Intents.php Class Class source
  Plain text file Message.php Class Class source
  Plain text file Workspace.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  Language  /  LanguageTranslator  
File Role Description
  Plain text file Translator.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  Language  /  Natural  
File Role Description
Files folder imageLanguage (1 file)

  Files folder image Files (23)  /  src  /  IBMWatson  /  Language  /  Natural  /  Language  
File Role Description
  Plain text file Understanding.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  Language  /  PersonalityInsights  
File Role Description
  Plain text file Profile.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  Speech  
File Role Description
Files folder imageTextToSpeech (2 files)

  Files folder image Files (23)  /  src  /  IBMWatson  /  Speech  /  TextToSpeech  
File Role Description
  Plain text file Synthesis.php Class Class source
  Plain text file Voice.php Class Class source

  Files folder image Files (23)  /  src  /  IBMWatson  /  Vision  
File Role Description
Files folder imageVisualRecognition (1 file)

  Files folder image Files (23)  /  src  /  IBMWatson  /  Vision  /  VisualRecognition  
File Role Description
  Plain text file Classifier.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:271
This week:0
All time:7,712
This week:524Up