Code Monkey home page Code Monkey logo

watson-nlu-dbpedia-app's Introduction

watson-nlu-dbpedia-app

A sample application that uses Watson Natural Language Understanding, DBpedia, and IBM Cloud Functions (OpenWhisk).


The client application is implemented with Vue.js. The UI enables a user to enter a url, preferably one that references a news article. The UI invokes a backend that analyzes the article's contents, identifies a subset of relevant entities, then looks up their details using DBpedia. Finally, the results are rendered as cards. Entities with locations will appear on a Google Map.

The backend is implemented using IBM Cloud Functions.

Try it out

To see the live working demo, navigate to https://nlu-web.mybluemix.net

Prerequisities

Setup

Server

  1. Login and set your target organization and space

    bx login
    bx target -o <YOUR-ORGANIZATION> -s <YOUR-SPACE>
  2. Apply your Watson Natural Language Understanding service credentials

    vi server/index.js
    

    Note: :wq! will save an exit from vi

  3. Replace line <YOUR-USERNAME> and <YOUR-PASSWORD> with your service credentials

    const nlu = new NaturalLanguageUnderstandingV1({
      username: '<YOUR-USERNAME>',
      password: '<YOUR-PASSWORD>',
      version_date: '2017-02-27',
    })
  4. Deploy the OpenWhisk action (IBM Cloud Function)

     bx wsk action update /<YOUR-ORGANIZATION>_<YOUR-SPACE>/demo/nlu_analyze index.js --web true --kind nodejs:8

Client

  1. Change the endpoint url to reference your new action's endpoint

    vi src/config.js
    export const nluNewsApiRoot = 'https://openwhisk.ng.bluemix.net/api/v1/web/<YOUR-ORGANIZATION>_<YOUR-SPACE>/demo'
  2. Install dependencies

npm install

Run (locally)

  1. Install dependencies

    npm start
  2. Navigate to http://localhost:8080

Deploy (IBM Cloud)

  1. Open ./manifest.yml and update name and host with <YOUR-USERNAME>-nlu-web

  2. Build for production

    npm run build
  3. Deploy

    cf push
  4. Navigate to https://YOUR-USERNAME.mybluemix.net

License

MIT

watson-nlu-dbpedia-app's People

Contributors

johnwalicki avatar kant avatar imgbotapp avatar

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.