Skip to content

Instantly share code, notes, and snippets.

@miguelmalvarez
Last active August 29, 2015 14:23
Show Gist options
  • Save miguelmalvarez/c3bfe19884fd29141137 to your computer and use it in GitHub Desktop.
Save miguelmalvarez/c3bfe19884fd29141137 to your computer and use it in GitHub Desktop.
(ns ibmwatson.text
(:require [clj-http.client :as client]))
(defn- text-call
[text endpoint params]
(let [root_url (str "http://access.alchemyapi.com/calls/text/" endpoint)]
(client/get root_url {:query-params params})))
(defn entities
[text api_key]
(let [params {"apikey" api_key
"text" text
"outputMode" "json"
"disambiguated" 1}]
(text-call text "TextGetRankedNamedEntities" params)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment