| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This application demonstrates how the Watson Conversation service can be used to build a simple on-board telco chat application.
Following services are used from IBM Cloud:
See the app demo
For more information about Conversation, see the detailed documentation.
The app interface is designed and trained for chatting with the telco customers. Your questions and commands are run against a small set of sample data trained with intents like these:
view profile view account edit email
These intents help the system to understand variations of questions and commands that you might submit.
Example commands that can be executed by the Conversation service are:
view profile edit emailId What are the available plans for Vodafone What are the available plans for Idea view my account view my bill
Ensure that you have a IBM Cloud account
This action deploys 1 application and 2 services. You can view this on your IBM Cloud Dashboard.
Log in with your existing IBM Cloud account or Sign up
Name your app and select your REGION, ORGANIZATION and SPACE. Then select DEPLOY.
The deploy performs two actions:
To see the status of your app, you can click "Delivery Pipeline".
The deployment can take some time.
Deployment of the app might FAIL. The reason for the failure is that we have to configure the cloudant database.
To configure the cloudant database please follow the below steps:
Click on "cloudant-db" from the IBM Cloud Dashboard. In the landing page, click on Launch button.
Click on Databases from left hand navigation. Click on "Create Database" from top right corner.
Give a name to the database, like telco-users
To load demo / sample data to the database, two versions of data are available under resources folder: telco-users-<number>.json and telco-users-cloudant.txt
Install couchimport tool to upload data to cloudant using the following commnands:
MAC / Linux:
Open the Terminal and run the following snippet:
sudo npm install -g couchimport
To get the URL, click on the App in Bluemix dashboard --> Runtime --> Environment Variable --> Under Cloudant service, check for the URL
export COUCH_URL="https://username:password@xxx-bluemix.cloudant.com"
export COUCH_DATABASE="telco-users"
cat telco-users-cloudant.txt | couchimport --db telco-users
Windows:
Open Command Prompt and run:
npm install -g couchimport (Refer https://nodejs.org/download/release/npm/ for npm installers)
To get the URL, click on the App in IBM Cloud dashboard --> Runtime --> Environment Variable --> Under Cloudant service, check for the URL
set COUCH_URL="https://username:password@xxx-bluemix.cloudant.com"
set COUCH_DATABASE="telco-users"
type telco-users-cloudant.txt | couchimport --db telco-users
Note:
Install node.js for your OS from https://nodejs.org/
To see if Node is installed, type the below on your command line
node -v
To see if Node Package Manager - npm is installed, type the below on your command line
npm -v
To use the app you're creating, you need to add a workspace to your Conversation service. A workspace is a container for all the artifacts that define the behavior of your service (ie: intents, entities and chat flows).
For more information on workspaces, see the full Conversation service documentation.
Navigate to the IBM Cloud dashboard, select the Conversation service that you created
Go to the Manage menu item and select Launch Tool. This opens a new tab in your browser, where you are prompted to login if you have not done so before. Use your IBM Cloud credentials.
Download the exported file that contains the Workspace contents by clicking exported JSON file
Select the import icon: . Browse to (or drag and drop) the JSON file. Choose to import Everything(Intents, Entities, and Dialog). Then select Import to finish importing the workspace.
Refresh your browser. A new workspace tile is created in the tool. Select the menu button within the workspace tile, then select View details:
In the Details UI, copy the 36 character UNID ID field. This is the WORKSPACE_ID. Retain this for the following step where we will create an environment variable. This varibale will be the handle for the application to refer to the Conversation Service that we created.
Launch the Watson Discovery tool. Create a new data collection and give the data collection a unique name.
Save the environment_id and collection_id for next step.
Under Add data to this collection use Drag and drop your documents here or browse from computer to seed the content with the four documents in resources/Discovery folder
Click on the deployed app from IBM Cloud Dashboard
Go to Runtime -> Environment variables section
Under "User defined" section at the botton, click on Add button
Under Name, enter WORKSPACE_ID (with out quotes) and under Value, copy the workspace id from importing workspace step
Click on Add button again and, enter DISCOVERY_USERNAME and under Value, copy the Disocvery service username
Click on Add button again and, enter DISCOVERY_PASSWORD and under Value, copy the Disocvery service password
Click on Add button again and, enter DISCOVERY_ENVIRONMENT_ID and under Value, copy the environment id from previous step
Click on Add button again and, enter DISCOVERY_COLLECTION_ID and under Value, copy the environment id from previous step
Click on Save button. The app will automatically restart.
Launch the application from IBM Cloud dashboard
Enter an username, say, ajay to login and see the chat bot working
This sample code is licensed under Apache 2.0. Full license text is available in LICENSE.
Find more open source projects on the IBM Github Page.
| Back | FazBrowse Home | New Git URL |