Skip to content
A chatbot for banking that uses the Watson Assistant, Discovery, Natural Language Understanding and Tone Analyzer services.
JavaScript CSS HTML Dockerfile
Branch: master
Clone or download
stevemar and markstur clean up deploy instructions (#120)
* clean up deploy instructions
Latest commit 72df3ce Aug 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data assistant skills for IN and US Aug 23, 2019
doc/source clean up deploy instructions (#120) Aug 29, 2019
launchConfigurations initial commit May 7, 2017
lib Update and fix several issues. Pin to pre-SDU. (#109) Jun 22, 2019
public upgrade Aug 23, 2019
test fixed test Aug 23, 2019
tools Add a workspace diff script to compare workspace with master in CI. Jun 14, 2017
.dockerignore Add starter kit support Nov 27, 2017
.eslintrc.js Move Watson Disco and Conv setup to lib for testability and reuse. Ad… Jun 7, 2017
.gitignore Add .vscode to .gitignore Jun 13, 2017
.travis.yml Update and fix several issues. Pin to pre-SDU. (#109) Jun 22, 2019
CHANGELOG.md initial commit May 7, 2017
CONTRIBUTING.md Mention troubleshouting, markdown fixes (#93) Dec 19, 2018
DEVELOPING.md change conversation to watson and rolledback var and func names Mar 20, 2018
Dockerfile Add starter kit support Nov 27, 2017
Dockerfile-tools Add starter kit support Nov 27, 2017
Jenkinsfile Add starter kit support Nov 27, 2017
LICENSE Revise license Nov 10, 2017
MAINTAINERS.md Duplicate word on string #9 (#79) Jun 12, 2018
README.md clean up deploy instructions (#120) Aug 29, 2019
app.js hack to show discovery QA (#114) Aug 24, 2019
banking_services.js Update dependencies Jun 1, 2018
banking_services_us.js upgrade Aug 23, 2019
cli-config.yml Add starter kit support Nov 27, 2017
env.sample hack to show discovery QA (#114) Aug 24, 2019
manifest.yml random-route false to prevent invalid routes Jun 1, 2018
package-lock.json Bump eslint-utils from 1.3.1 to 1.4.2 Aug 26, 2019
package.json Update and fix several issues. Pin to pre-SDU. (#109) Jun 22, 2019
server.js Use const and let (no var) add use strict. Allow console.log. Jun 2, 2017

README.md

Build Status

Watson Conversation is now Watson Assistant. Although some images in this code pattern may show the service as Watson Conversation, the steps and processes will still work.

Create a banking chatbot with FAQ discovery, anger detection and natural language understanding

In this code pattern, we will create a chatbot using Node.js and Watson Assistant. The Assistant flow will be enhanced by using Natural Language Understanding to identify entities and using Tone Analyzer to detect customer emotions. For FAQs, a call to the Discovery service will use passage retrieval to pull answers from a collection of documents.

When the reader has completed this pattern, they will understand how to:

  • Create a chatbot that converses via a web UI using Watson Assistant and Node.js
  • Use Watson Discovery with passage retrieval to find answers in FAQ documents
  • Use Watson Tone Analyzer to detect emotion in a conversation
  • Identify entities with Watson Natural Language Understanding

architecture

Flow

  1. The FAQ documents are added to the Discovery collection.
  2. The user interacts with a chatbot via the app UI.
  3. User input is processed with Tone Analyzer to detect anger. An anger score is added to the context.
  4. User input is processed with Natural Language Understanding (NLU). The context is enriched with NLU-detected entities and keywords (e.g., a location).
  5. The input and enriched context is sent to Assistant. Assistant recognizes intent, entities and dialog paths. It responds with a reply and/or action.
  6. Optionally, a requested action is performed by the app. This may include one of the following:
    • Lookup additional information from bank services to append to the reply
    • Use Discovery to reply with an answer from the FAQ documents

Included components

  • IBM Watson Assistant: Build, test and deploy a bot or virtual agent across mobile devices, messaging platforms, or even on a physical robot.
  • IBM Watson Discovery: A cognitive search and content analytics engine for applications to identify patterns, trends, and actionable insights.
  • IBM Watson Natural Language Understanding: Analyze text to extract meta-data from content such as concepts, entities, keywords, categories, sentiment, emotion, relations, semantic roles, using natural language understanding.
  • IBM Watson Tone Analyzer: Uses linguistic analysis to detect communication tones in written text.

Featured technologies

  • Node.js: An asynchronous event driven JavaScript runtime, designed to build scalable applications.

Deployment options

Cloud Foundry OpenShift Local
public openshift local

Sample output

demo

Troubleshooting

  • Fail: An operation for service instance wbc-discovery-service is in progress.

    This error occurs when starting the app before the service is ready. It is currently common behavior with the Deploy to IBM Cloud button. In this case, run the deploy stage again. It should succeed when the service is ready.

  • Error: Server error, status code: 409, error code: 60016, message: An operation for service instance wbc-discovery-service is in progress.

    This indicates that the Discovery service is still being provisioned. Wait a few minutes and click the Run button to restart the application.

  • Error: Environment {GUID} is still not active, retry once status is active

    This is common during the first run. The app tries to start before the Discovery environment is fully created. Wait a few minutes and click the Run button to restart the application.

  • Error: Only one free environment is allowed per organization

    To work with a free trial, a small free Discovery environment is created. If you already have a Discovery environment, this will fail. If you are not using Discovery, check for an old service thay you may want to delete. Otherwise use the .env DISCOVERY_ENVIRONMENT_ID to tell the app which environment you want it to use. A collection will be created in this environment using the default configuration.

Links

License

This code pattern is licensed under the Apache License, Version 2. Separate third-party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.

Apache License FAQ

You can’t perform that action at this time.