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.
-
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.
-
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).
-
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.
-
The articles, TED talks, and Wikipedia pages derived from the concepts, are presented to the user.
-
Lastly, the article is submitted to Watson to be added to the corpus for future searches.
Synaptic needs a few configuration steps to work. Basically you need to open a Watson account and a Readability account.
-
Start with creating a Bluemix account and activating an instance of the Concept Insights service.
-
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
-
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'
- 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'
-
Create a Readability account and get your Readability Parser API token
-
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
- If you deployed to Heroku, use to set the environment variables
$ figaro heroku:set -e production
Shared under MIT licence