Developers use RESTful APIs to process plain text and get JSON responses like:
{"tags":[[["news_war",0.607]],"people":[["President","George","Bush"]],
"places":["Iraq"],"companies":["SAIC"],"products":["Pepsi"],
"sentiment":["positive",0,"negative",0.23]}I set an environment variable on my laptop and servers with my KBSPortal auth token (this example is not a real token):
export KBSPORTAL_AUTH=9914724463905176354210
Using the REST APIs, it is easy to access this service from any programming language. Here is a simple example Ruby client:
require 'simple_http'
require 'json'
require 'pp'
AUTH = ENV['KBSPORTAL_AUTH']
def nlp text
text2 = URI.encode(text)
http = SimpleHttp.new 'http://kbsportal.com/json/' + AUTH + '/' + text2
JSON.parse(http.get)
end
pp nlp('President Bush went to Mexico on vacation after addressing Congress on the state of the Iraq war.')
Currently, all text analysis functions are applied in each API call and all results are returned. User comments are welcome - if this or any other aspect of the KBSPortal service is inconvenient for you please see the contact page.
Input text is assumed to be plain text (punctuation is fine). Notice that in this example Ruby client that I am calling URI.encode(text) to properly encode the text: the URL must be a legal URL! If you need to process HTML marked up text then remove the HTML tags in your application before calling the KBSPortal service.
Note: KBSPortal.com is hosted in the Amazon AWS U.S. East region. For production use it is recommended that your applications using KBSPortal.com should also be hosted in the same region.