news.

The Power of APIs: A Hypothetical SkyNet

APIs are becoming more and more popular each day. A lot of new APIs are being launched every day, some useful and others just plain awesome. I work APIs every day and sometimes discover quite interesting ways to mash them up.

With the launch of Google’s prediction API, it got me wondering whether it is possible to train an AI with it or at least do some sort of intelligent reasoning by only using available APIs. I looked around and found some other useful APIs to work with it.

Let’s imagine we want a bot that when given certain keywords, be able to deduce what you are talking about and then reply with a seemingly coherent answer. First we need to learn it.

Let’s ask it: “What do you think about Google buying out Motorola?”

Step 1: First we push the sentence through AlchemyAPI to extract context and meaning through its “named entity extraction”, “keyword extraction” and “categorization” APIs. We will also use OpenCalais to do the same in order to get a varied result back. Now we have a great set of terms, entities, and general idea what the question is about.

Step 2: The next step is to use dictionary.com’s synonyms API to get any synonyms that can gives the question a bit broader context.

Step 3: This step requires some assumption. Let’s assume that the questions that are to be asked to our bot is usually relevant to current events. Even if it is not, it will give it a bit more perspective even though it is a not a current event question.

Take all the entities that was gained from keyword extraction (in this case it would be Google and Motorola) and use Twitter’s search API. This will return a great amount of Tweets with “Google” in it, and with the word “Motorola” in it.

Step 4: Now that we have all these tweets, do step 1 and step 2 with all these tweets. Now we will have a greater set of entities as well as more synonyms relating to the question. For example, someone could’ve tweeted: “Google bought Motorola! Wow, well done Larry and Sergei”. Now two new entities are included in the set, ie Larry and Sergei.

Step 5: Now we have a large set of tweets, entities, keywords, etc. Now we push it all into Google’s Prediction API. Given inputs, Google’s prediction API learns what is most likely the discussion to be about. If the bot for some reason can’t figure out an answer, it could through its learning (lots of questions) discover that at least Google is related to tech or web, and ask a question back to the user that someone asked, ie “I don’t know, but what do you think of Android?”

And so it learns and learns by using the power of APIs and the flow of information being created by humanity on Twitter. Watch out, maybe we could see a totally artificial twitter personality appear. Skynet is coming.

,

2 Comments

  1. 1
    Heinrich on Monday 29 August, 10:21 AM #

    Awesome post and idea. Just a quick thought before I shoot off to class.

    Won’t the fact that most people are uninformed have a bad result on the effectiveness of this? Most people only tweet what they hear or read. And if you look at some of the ridiculous questions asked on google (my favorite: “Do midgets glow in the dark?”), won’t you receive incorrect info?

    Ek dink die beste idee is om dit te ‘implement’ en te kyk wat dit doen ;)

Trackbacks/Pingbacks

  1. Shotbeak.com » Blog Archive » Github, jazz and the future of interfaces. - September 10, 2011

    [...] I wrote a blogpost on bandwidthblog, detailing OS X Lion’s interface and spitballing why Apple chose to make it look more like iOS. I also wrote a post on the MIH Medialab blog on the power of APIs. [...]

Leave a comment

Leave a Reply

(required)