Create an app to perform intelligent searches on data  

Develop a web app to extract and visualize enriched data using Node.js and Watson Discovery

Last updated | By Rich Hagarty

Description

A standard search for a site can return too many results for someone to want to go through. However, it’s possible to quickly build out a search interface for your Watson Discovery instance using out-of-the-box UI components that query and manipulate the enriched data to return more relevant search results. This code pattern uses publicly available reviews on Airbnb listings to demonstrate how to use individual UI components to visualize insights. You can then easily switch out the dataset to adapt it to your own use cases.

Overview

By querying and manipulating enriched data, you can build a more insightful search interface. This code pattern provides a Node.js app built on the Watson Discovery Service that does just that. The pattern demonstrates how you can use individual out-of-the-box UI components to extract and visualize the enriched data provided by the Watson Discovery analytics engine.

The main benefit of using the Watson Discovery Service is its powerful analytics engine that provides cognitive enrichments and insights into your data. The app in this code pattern provides examples of how to showcase these enrichments through the use of filters, lists, and graphs. The key enrichments are:

  • Entities: People, companies, organizations, cities, and more
  • Categories: Classification of the data into a hierarchy of categories up to 5 levels deep
  • Concepts: Identified general concepts that aren’t necessarily referenced in the data
  • Keywords: Important topics typically used to index or search the data
  • Sentiment: The overall positive or negative sentiment of each document

The app uses standard search UI components such as filter lists, tag clouds, and sentiment graphs, but also more complex Discovery options such as the passages and highlight features. With these two features, the app identifies the most relevant snippets in your data based on your query and is more likely to return the data that you’re searching for.

When you have completed this code pattern, you should know how to:

  • Load and enrich data in the Watson Discovery Service.
  • Query and manipulate data in the Watson Discovery Service.
  • Create UI components to represent enriched data created by the Watson Discovery Service.
  • Build a complete web app that utilizes popular JavaScript technologies to feature Watson Discovery Service data and enrichments.

Flow

  1. Add the Airbnb review JSON files to the Discovery collection.
  2. Use the app UI to interact with the back-end server. The front-end app UI uses React to render search results and can reuse all of the views that are used by the back end for server-side rendering. The front end is using semantic-ui-react components and is responsive.
  3. Discovery processes input and routes it to the back-end server, which is responsible for server-side rendering of the views displayed on the browser. The back-end server is written using Express and uses an express-react-views engine to render views that are written using React.
  4. The back-end server sends user requests to the Watson Discovery Service. It acts as a proxy server, forwarding queries from the front end to the Watson Discovery Service API while keeping sensitive API keys concealed from the user.

Instructions

Find the detailed steps for this pattern in the README. Those steps will show you how to:

  1. Clone the watson-discovery-ui GitHub repo.
  2. Create the Watson Discovery service.
  3. Load the Discovery files.
  4. Configure the credentials.
  5. Run the application.

Related Blogs

Related Links

Architecture center

Learn how this code pattern fits into the Cognitive discovery Reference Architecture