This repository delivers a UI for cognitive training of a bot that has been instrumented with hubot-ibmcloud-cognitive-lib and hubot-ibmcloud-nlc. See the respective Readme files for more details.
In general, enabling a bot for natural language involves early manual training, which is limited. It must still learn based on real human interaction. During usage of a bot, logic from IBM Watson makes decisions based on levels of confidence. When confidence isn't high, there is an opportunity for added learning. The user interaction is recorded in a database for future reference. The UI delivered by this project allows one to review those interactions and either accept or deny them as new data for future training.
Beyond the UI implemented in this project is a lot of interaction with the Cloudant NoSQL DB, hosted on Bluemix, and initially set up as part of integrating natural language into your bot with hubot-ibmcloud-cognitive-lib. An instance of the Cloudant NoSQL DB service must exist already, and will be referenced in the following section.
Follow these steps if you would like to integrate the Cognitive UI into your hubot:
cd
into your hubot directory- Install this package via
npm install hubot-ibmcloud-cognitive-ui --save
- Add
hubot-ibmcloud-cognitive-ui
to yourexternal-scripts.json
- Add the necessary environment variables:
- Identify your Cloudant credentials.
From the Bluemix dashboard, click on your Cloudant NoSQL DB service instance. You should see something like the following:
Click Service Credentials
in the left panel. The value for host
will map to an environment variables needed shortly.
- Identify the Cloudant key and database value.
From the same dashboard listed in the previous step, click theLaunch
button to bring up the Cloudant dashboard. You should see something like the following:
With Databases
selected on the left, find the name of the database that was created and associated with hubot-ibmcloud-cognitive-lib
. Click on that name to see the details. Then click Permissions
where you'll find the API Key on the right. Both the database name and API key are used below.
- Update the environment variable settings in the file
config/env
.
export HUBOT_CLOUDANT_HOST=<Cloudant credentials value for "host">
export HUBOT_CLOUDANT_KEY=<Cloudant API key>
export HUBOT_CLOUDANT_PASSWORD=<Cloudant database password>
export HUBOT_CLOUDANT_DB=<Cloudant database name>
- Start up your bot & off to the races!
hubot training ui
- Provides the URL to thehubot-ibmcloud-cognitive-ui
app
Follow these steps if you would like to run the Cognitive UI as a standalone app:
- Run
npm install
to obtain all the dependent node modules - Identify your Cloudant credentials.
From the Bluemix dashboard, click on your Cloudant NoSQL DB service instance. You should see something like the following:
Click Service Credentials
in the left panel.
3. Update the environment variable settings in the file config/env
.
export CLOUDANT_USERNAME=<Cloudant credentials value for "username">
export CLOUDANT_PASSWORD=<Cloudant credentials value for "password">
export PORT=<Optional Port, default is 3000>
-
To run the UI Locally
npm run start:dev
Go to http://localhost:3000/training in the browser, substituting 3000 with the value for
PORT
in the environment variables if that option was taken.
See LICENSE.txt for license information.
Please check out our Contribution Guidelines for detailed information on how you can lend a hand.