Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

IBM/watson-discovery-news

Repository files navigation

This repo has been archived and is no longer being maintained.

Build Status

Query Watson Discovery News using the Watson Discovery Service

Summary

The web is home to massive amounts of data, with more being created every day. Organizations can harness this constant stream of information to gain understanding, plan strategies, and find opportunities. Enriched news data can help your application make dynamic connections across current events faster. In this exercise, you'll start with the basics and build your own news mining web application using JavaScript, Node.js, and the Watson Discovery service. In this exercise:

  • Code is written in Node.js, with the server-side using the Express framework and the client using ReactJS.
  • You'll use the pre-built Watson Discovery News collection
  • You'll access the Watson Discovery service through the Watson Discovery API

Optionally, you can choose to:

  • Host the app on the IBM Cloud

Description

This code pattern shows you how to tap into massive data sets to mine insight. You'll build a news mining web application with the Watson Discovery service using the Watson Node.js SDK. The app demonstrates two use cases using Watson Discovery News:

  • Search: Query for the most relevant new articles about a specific topic or subject. Because the news collection is pre-enriched with natural language processing, you can query not just on keywords or categories but also on concepts, sentiment, and relations to get richer search responses.

Flow

architecture

  1. The user interacts with the Watson Discovery News Server via the app UI.
  2. User input is processed and routed to the Watson Discovery News Server.
  3. The Watson Discovery News Server sends user requests to the Watson Discovery Service.
  4. The Watson Discovery Service queries the Watson News Collection.

Included components

  • Watson Discovery: A cognitive search and content analytics engine for applications to identify patterns, trends, and actionable insights.

Featured technologies

  • Node.js: An asynchronous event driven JavaScript runtime, designed to build scalable applications
  • React: Javascript library for building User Interfaces
  • Express: A popular and minimalistic web framework for creating API and Web server

Watch the Video

Deployment options

Click on one of the options below for instructions on deploying the app.

openshift public local

Troubleshooting

If you see the following in the logs for a Deploy to IBM Cloud using Cloud Foundry in the Stage History, click the Redeploy button. This should get past the race condition during the deployment.

Binding service discovery-news-service to app sda-watson-discovery-news-9-4 in org scott.dangelo / space dev as scott.dangelo@ibm.com...
FAILED
Could not bind to service discovery-news-service
Error: Server error, status code: 409, error code: 60016, message: An operation for service instance discovery-news-service is in progress.

Finished: FAILED

Sample output

The trending page:

demo


The query page:

demo


Deep Dive Videos

Here is a series of short videos that go into more of the details about the features of this code pattern.

  • Part 1 - Navigating the UI
  • Part 2 - Code walkthrough
  • Part 3 - Watson Discovery service APIs

Links

Learn more

  • Artificial Intelligence Code Patterns: Enjoyed this Code Pattern? Check out our other AI Code Patterns.
  • AI and Data Code Pattern Playlist: Bookmark our playlist with all of our Code Pattern videos
  • With Watson: Want to take your Watson app to the next level? Looking to utilize Watson Brand assets? Join the With Watson program to leverage exclusive brand, marketing, and tech resources to amplify and accelerate your Watson embedded commercial solution.

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