Giter Club home page Giter Club logo

synaptic's Introduction

Synaptic

AI-based content discovery based on IBM's Watson Concept Insights API

Share a blog post, an interesting article, a page from Medium or Quora. Synaptic will understand the concepts discussed and share back TED Talks, articles shared by other people, and Wikipedia pages.

You can test it live on Synaptic hosted app, where the content already shared by many people will make the results more interesting.

It is a Ruby on Rails app that can be deployed, for example, on Heroku. It does not require to be hosted on IBM's Bluemix, as it hits the API endpoints from HTTP requests.

How it works

  1. This app is intended to demo the potential of the API, building upon and going further than IBM's demo. Instead of inputting a body of text, we require only a link to a webpage, and use Readability's Parser API to get the main text of the page.

  2. The body of text is analyzed using Concept Insights "annotate_text" endpoint for fast performance. It extracts concepts, and the top 3 concepts are used to fetch documents (this number can be configured in an environment variable).

  3. Two requests are made, one against a corpus of previously-submitted articles, and another one against a public corpus of TED talks, using the "conceptual_search" API call.

  4. The articles, TED talks, and Wikipedia pages derived from the concepts, are presented to the user.

  5. Lastly, the article is submitted to Watson to be added to the corpus for future searches.

Configuration

Synaptic needs a few configuration steps to work. Basically you need to open a Watson account and a Readability account.

  1. Start with creating a Bluemix account and activating an instance of the Concept Insights service.

  2. From the Bluemix console, open the instance. In "Service Credentials" (you may have to create a new set of credentials if they don't already exists), get your username and password

  3. Use this curl command to get your concept insights account ID (replace USERNAME and PASSWORD)

curl -u USERNAME:PASSWORD 'https://gateway.watsonplatform.net/concept-insights/api/v2/accounts'
  1. Use this curl command to get create to concept insights corpus - one for tests and development, and one for production (replace USERNAME, PASSWORD, ACCOUNT by their values, and choose a name for CORPUS)
curl -u USERNAME:PASSWORD -X PUT -d '{"access":"private'}' 'https://gateway.watsonplatform.net/concept-insights/api/v2/corpora/ACCOUNT/CORPUS'
  1. Create a Readability account and get your Readability Parser API token

  2. In /config, create an application.yml file that looks like this (figaro gem is already bundled) :

READABILITY_TOKEN: XXXXXXXXXXXXXXXX
WATSON_USERNAME: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
WATSON_PASSWORD: XXXXX
WATSON_ACCOUNT: XXXXX
MAX_CONCEPTS: "3"

production:
  WATSON_CORPUS: XXXXX

development:
  WATSON_CORPUS: XXXXX
  1. If you deployed to Heroku, use to set the environment variables
$ figaro heroku:set -e production

Author

Matthieu Varagnat

Licence

Shared under MIT licence

synaptic's People

Contributors

mvaragnat avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

openube

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.