This is the guide for preparing Bluemix and Docker environments
- Update
~/Desktop/Chatbot/Docker.env
with credentials
- Please be aware of the variables of the values DO NOT HAVE quotes and between key and value there is a
=
, e.g.key
=value
-
Good example:
VISUAL_RECOGNITION_API_KEY=abcdefghijklmnopqrstuvwxyz12345678901234
-
Bad example
VISUAL_RECOGNITION_API_KEY="abcdefghijklmnopqrstuvwxyz12345678901234"
-
Create Watson services
-
After register the Bluemix account, then sign in
-
Go to Bluemix catalog, search
Visual Recognition
-
Click
Create
button after selecting theFree plan
-
Click on
Service credentials
tab, then select credential dropdown button, copyapi_key
-
Update
~/Desktop/Chatbot/Docker.env
, paste copiedapi_key
toDocker.env
Train Visual Recognition
API with the training files, get new trained classifier ID then apply it in ~/Desktop/Chatbot/Docker.env
-
Go back to Bluemix console, go back to
Manage
tab then click onVisual Recognition Tool (Beta)
button to launch theVisual Recognition Tool
-
Due to the GFW blocked the unsecured connection of Bluemix as below, use https://visual-recognition-tooling.mybluemix.net/
-
For the first time visit of this tool, the API key is needed for authentication
-
Then click on
Create
button to get started -
You will see this page, go to next step refer to following step
-
Choose training zip files from
/Chatbot-training
folder, then chooseALL
of them according to the class names including the negative sample -
Name each of the classes
-
Copy the
classifier ID
-
Paste
classifier ID
in~/Desktop/Chatbot/Docker.env
-
Go to Bluemix catalog, search
Conversation
-
Name service as you want, and make sure there is a
Credential name
available then click onCreate
button -
Then you will see this page, and click on
Service credentials
, then copy username and password -
Paste
username
andpassword
in~/Desktop/Chatbot/Docker.env
-
Start creating a new
Conversation
, click onManage
menu on the left then click onLaunch tool
-
For the first time visit of this tool, the IBM ID is needed for authentication, but as long as you've authenticated by Bluemix, it will treat you as a authorized user after clicking on the
Log in with IBM ID
by default. Otherwise you can try to sign in again with your Bluemix credentials -
Click on
Upload
icon to upload the training file, to locate the training file, go to/Chatbot-training/conversation
folder, findinnovation-day.json
file -
There will be one more panel named
iChat
, click on the menu on the top right, then selectView details
in order to copy workspace ID -
Paste
workspace ID
in~/Desktop/Chatbot/Docker.env
-
Go to Bluemix catalog, search
Speech to Text
-
Name service as you want, and make sure there is a
Credential name
available then click onCreate
button -
Then you will see this page below, go to next step refer to following step
-
Copy
username
andpassword
, paste them to~/Desktop/Chatbot/Docker.env
and save the file -
Go to Bluemix catalog, search
Text to Speech
-
Then you will see this page below, go to next step refer to following step, then copy username and password
-
Paste
username
andpassword
in~/Desktop/Chatbot/Docker.env
-
Update
~/Desktop/Chatbot/Docker.env
with your Blockchain service URL, replace it with actual one if you're hosting the Blockchain service on the Bluemix (refer to Blockchain practice)APPLICATION_API_URL=https://your_block_chain_service.mybluemix.net
-
Get
IP
address from the Virtual Machine -
In Virtual Machine, replace the URL with service URL with your
IP
address and Blockchain service port, assume it ishttp://10.0.2.15:3000
APPLICATION_API_URL=http://10.0.2.15:3000
Now you're ready for building the Docker
image.
-
Open the
Terminal
and run the Docker build commanddocker run -p 8888:9080 --env-file ~/Desktop/Chatbot/Docker.env chatbot
-
Wait for the message
The server defaultServer is ready to run a smarter planet.
-
Now you can visit the Chatbot web application via http://10.0.2.15:8888/
- Note that the Shipping address
CAN NOT
beBeijing
,Shanghai
,Wuhan
,Chengdu
,Dalian
, orShenzhen
as they are treated astransit
. Use other cities in the world, likeTokyo
, or some other locations you like.