Git Product home page Git Product logo

ibm-watson-php-library's Introduction

#IBM Watson PHP Library

A Library which uses PHP to make communicating with the IBM Watson library easier.

This is still in development, feedback is welcome.

##Speech To Text IBM PHP

This API is complete, however it hasn't been heavily tested and I am yet to write and PHP Unit tests for it, please feel free to submit a pull request if you would like to write any tests or improve the class in anyway.

###How to use

To instantiate:

$config = new Config();
$config->setUsername('IBM_SPEECH_TO_TEXT_USERNAME');
$config->setPassword'IBM_SPEECH_TO_TEXT_PASSWORD');

$speechToText = new SpeechToText($config);

The whole IBM Library uses Guzzle, to set options you can use $config->setConfig($key, $value); You can also pass an array of items like shown below:

$params = ['headers' => 'X-Brideo']
$speechToText->config->setConfig($params)

There is a helper request() method which wraps the Guzzle Client request method, however the parameters are in a slightly different order so you may want to check that.

To recognize a file:

$filePath = 'example.ogg';
$speechToText->recognize($filePath, 'audio/ogg')

To get the transcripts of the last recognized file you can run $speechToText->getTranscripts()

Other commands are:

  • observeResult()
  • recognizeStatus()

##Concept Insights

This is still in development, however you can currently create, delete, update and retrieve Corpus and Document.

$config = new Config();
$config->setUsername('username');
$config->setPassword('password');

$corpus = CorpusFactory::create('testCorpusBrideo', Corpus::DEFAULT_REQUEST_METHOD, $config);
$corpus->delete();
$corpus->create();


$document = DocumentFactory::create($corpus, $config, 'testDocumentBrideo');
$document->create();

#Todos

  • Write PHP Unit Tests
  • Add Documents to corpus

ibm-watson-php-library's People

Contributors

brideo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dubems

ibm-watson-php-library's Issues

Typo in README.md

$config->setPassword'IBM_SPEECH_TO_TEXT_PASSWORD');

Should be:

$config->setPassword('IBM_SPEECH_TO_TEXT_PASSWORD');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.