IBM/watson-news-intelligence-starter-kit

Name: watson-news-intelligence-starter-kit

Owner: International Business Machines

Description: This Code Pattern demonstrates how to query news content to understand what people are saying or feeling about important topics.

Created: 2018-05-08 22:00:44.0

Updated: 2018-05-21 19:20:38.0

Pushed: 2018-05-21 19:20:37.0

Homepage: null

Size: 1939

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Watson News Intelligence

The Watson News Intelligence Code Pattern for Node.js visualizes the results of Discovery queries. The app searches Discovery News data to get insights from the news, including related concepts, entities, and sentiment trends.

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

Flow
  1. The Watson Discovery Service is continually crawling the web to update its Discovery News collection.
  2. The user interacts with the app UI to request relevant news content.
  3. The app sends user requests to Watson Discovery News.
Included components
Featured technologies

Steps

This Code Pattern is based on a Starter Kit. You can use this repo stand-alone by following the run locally instructions below, or use the Try the starter kit button to take advantage of additional deployment options.

Try the Starter Kit

Try the starter kit

  1. Press the above Try the starter kit button.

  2. Review/edit the details on the Create app page and then click on Create.

  3. Optionally, click on Download code to download the Starter Kit code. This will give you a zip file of generated code giving you additional options to run locally, including:

  4. Running locally with Docker

  5. Running locally and deploying to the IBM Cloud as a Cloud Foundry application

  6. Click on the Deploy to Cloud button to deploy directly to the IBM Cloud with the following options:

  7. Provision the app to a Kubernetes cluster

  8. Deploy the app as a Cloud Foundry app

If using these Starter Kit options, follow the instructions in the UI and/or the download.

Run locally

NOTE: These steps are only needed when running locally instead of using the Try the starter kit button.

  1. Clone the repo
  2. Create Watson services with IBM Cloud
  3. Configure credentials
  4. Run the application
1. Clone the repo

Clone the watson-news-intelligence-starter-kit locally. In a terminal, run:

t clone https://github.com/markstur/watson-news-intelligence-starter-kit
2. Create Watson services with IBM Cloud

Create the following services:

3. Configure credentials

The credentials for IBM Cloud services (Discovery), can be found in the Services menu in IBM Cloud, by selecting the Service Credentials option for the service.

Copy the Discovery credentials JSON into your local repos server/localdev-config.json file.

Example server/localdev-config.json:

atson_discovery_url": "https://gateway.watsonplatform.net/discovery/api",
atson_discovery_username": "a111aaaa-1a1a-111a-a11a-1aaa1111aaa1",
atson_discovery_password": "aaAAA1aaaAaa"

4. Run the application
  1. Install Node.js (LTS supported versions).

  2. At the command line, go to your project directory.

  3. Install the dependencies:

    install
    
  4. Start the app:

    start
    
  5. Point your browser to localhost:3000.

Sample output

Enter a company name in the search bar to query Watson Discovery News through the app. Each panel on the page contains a visual presentation of insights derived from the API response. Press View Query in each panel to view the parameters of the API request and the response in JSON form.

For your first search, enter the name of a company (or some news topic) and hit enter or click on the magnifying glass icon.

After your first search, you can change the search term, and you can specify the time period for your search.

The results will include the following sections.

Top Entitites

Top Entities shows a word cloud showing frequently mentioned entities for your search term. The words are sized to indicate their significance. You can click on the tabs to show entities that are topics, companies, or people.

Top Stories

Top Stories shows the top news stories that matched your search. You can sort the articles by relevance or by date.

Sentiment Analysis

Sentiment Analysis shows the positive/neutral/negative sentiment breakdown of the news articles from a variety of news sources.

Anomaly Detection

Anomaly Detection shows the number of articles over the specified time period and highlights anomalies, if any, with a red dot. You can hover over the chart to get additional details about each data point – including an example headline.

Co-Mentions & Trends

Co-Mentions & Trends shows entities that are commonly co-mentioned with your search entity and charts the trend for each entity pair. The chart tracks positive and negative sentiment for the pair over time. The total number of mentions and overall sentiment is also listed for each co-mentioned entity pair.

Screenshot

Example results from a week with Hawaiian volcano activity:

Links

Learn more

License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.