Code Monkey home page Code Monkey logo

cognitive-event-finder's Introduction

๐Ÿšซ This project is no longer maintained

Cognitive Event Finder

Cognitive Event Finder is a web-based chatbot for finding events/sessions at conferences. It uses Watson Conversation to manage the chat, Cloudant for retrieving events, and Mapbox for mapping.

We recently feature the Cognitive Event Finder at SXSW. You can see a working version @ https://cognitive-event-finder.mybluemix.net/ where you can search for SXSW events.

Quick Reference

The following environment variables are required to run the application:

MAPBOX_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONVERSATION_USERNAME=xxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxxx
CONVERSATION_PASSWORD=xxxxxxxxxxxx
CONVERSATION_WORKSPACE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CLOUDANT_URL=https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-bluemix.cloudant.com
CLOUDANT_DB_NAME=xxxxxxxxxx

We will show you how to configure the necessary services and retrieve these values in the instructions below:

Prerequisites

The following prerequisites are required to run the application.

  1. A Bluemix account.
  2. A Watson Conversation service provisioned in your Bluemix account.
  3. A Cloudant service provisioned in your Bluemix account.
  4. A Mapbox access token.

To run locally you will need Node.js 4.3.2 or greater.

To push your application to Bluemix from your local development environment you will need the Bluemix CLI and Dev Tools.

Local Development Environment

We'll start by getting your local development environment set up. If you haven't already installed Node.js you can install it by following the instructions here.

From the command-line cd into the cognitive-event-finder directory:

git clone https://github.com/ibm-cds-labs/cognitive-event-finder
cd cognitive-event-finder

Install dependencies:

npm install

Copy the .env.template file included in the project to .env. This file will contain the environment variable definitions:

cp .env.template .env

Mapbox

The application requires that you have a free Mapbox account and API token.

To sign up for a Mapbox account go to https://www.mapbox.com/signup/.

To create an API token go to https://www.mapbox.com/studio/account/tokens/.

Once you have your API token copy it to your .env file:

MAPBOX_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Bluemix

If you do not already have a Bluemix account click here to sign up.

Login to your Bluemix account.

Watson Conversation

First, we'll walk you through provisioning a Watson Conversation service in your Bluemix account:

  1. From your Bluemix Applications or Services Dashboard click the Create Service button.

    Bluemix

  2. In the IBM Bluemix Catalog search for Watson Conversation.

  3. Select the Conversation service.

    Watson Conversation

  4. Click the Create button on the Conversation detail page.

  5. On your newly created Conversation service page click the Service Credentials tab.

    Watson Conversation

  6. Find your newly created Credentials and click View Credentials

    Watson Conversation

  7. Copy the username and password into your .env file:

    CONVERSATION_USERNAME=xxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxxx
    CONVERSATION_PASSWORD=xxxxxxxxxxxx
    

Next, let's launch the Watson Conversation tool and import our conversation workspace.

  1. Go back to the Manage tab.

  2. Click the Launch tool button.

    Watson Conversation

  3. Log in to Watson Conversation with your Bluemix credentials if prompted to do so.

  4. On the Create workspace page click the Import button.

    Watson Conversation

  5. Choose the workspace.json file in the application directory (cognitive-event-finder/workspace.json).

  6. Click the Import button.

    Watson Conversation

  7. Under Workspaces you should now see the Cognitive Event Finder.

  8. Click the menu button (3 vertical dots) and click View Details

    Watson Conversation

  9. Copy the Workspace ID and paste it into your .env file:

    CONVERSATION_WORKSPACE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

Cloudant

We're almost there! Next, we'll provision an instance of Cloudant in our Bluemix account. After this step we will be able to run our bot locally.

  1. From your Bluemix Applications or Services Dashboard click the Create Service button.

  2. In the IBM Bluemix Catalog search for Cloudant.

  3. Select the Cloudant NoSQL DB service.

    Cloudant

  4. Click the Create button on the Cloudant detail page.

  5. On your newly created Cloudant service page click the Service Credentials tab.

  6. Find your newly created Credentials and click View Credentials

  7. Copy the username, password, and the url into your .env file:

    CLOUDANT_USERNAME=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-bluemix
    CLOUDANT_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    CLOUDANT_URL=https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-bluemix.cloudant.com
    

Next, create the following databases in Cloudant:

  1. sxswsessions
  2. sxswusers
  3. sxswlogs

Note: You can specify alternative names for these databases. If you do so be sure to update your .env file.

Finally, we need to populate our sxswsessions database. We've made the list of SXSW events available @ https://opendata.cloudant.com/sxswsessions.

You can use the replication feature in Cloudant to copy these events into your Cloudant database.

  1. In Cloudant select Replication.

  2. Click the New Replication button:

    Cloudant

  3. Configure the replication task as follows:

    Cloudant

Run Locally

We're now ready to test our bot. From the command-line run the following command:

npm start

If all is well you should see output similar to the following:

Getting event database...
Server starting on http://localhost:6018
Getting user database...
Getting dialog database...

To interact with the bot go to the URL printed in the log. Here's a sample conversation:

Screenshot

License

Licensed under the Apache License, Version 2.0.

cognitive-event-finder's People

Contributors

markwatsonatx avatar rajrsingh avatar ryanbaumann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cognitive-event-finder's Issues

Map style

  • Consider using a Mapbox Light style with dark building extrusions (ideally highlighting a building by name)
  • Call out the number of events clustered in one location with a symbol if >1 event
  • Use comment/document symbol from IBM design guide as marker
  • Distinct markers for music and films in a similar style as ^^

Chatbot design

  • Maintain the position but shrink the vertical size of the Watson chatbot
  • Make the chatbot look like iOS text messaging
  • Use image from header for Watson avatar
  • Get a better user avatar
  • Make the Watson icon prominent and simple in the bottom right corner of the map.

Suggestion results

Search for events starting within 30 minutes with a preference for those containing IBM or mapping in the description

Map popups

Popups labels should have a monotone white background, and links should be underlined instead of using a color

Header design

Can we ask IBM design for a recommended header design to match the theme?

General page styling

  1. Remove the GitHub logo, it commands too much attention in the display
  2. Make fonts consistent with IBM design guide

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.