Docsity

Exploiting Intelligence - Lecture Slides | CS 6452, Exams of Computer Science

Partial preview of the text

Download Exploiting Intelligence - Lecture Slides | CS 6452 and more Exams Computer Science in PDF only on Docsity!

Exploiting Intelligence

Week 10

What is Intelligence?

 (^) For computers: any behavior that mimics human thought processes  (^) Including but not limited to:  (^) Learning  Reasoning  (^) Decision making  (^) Generally speaking, there’s not an agreed upon definition of what intelligence is that doesn’t depending on relating it to human intelligence

How to Exploit AI Techniques

 (^) Find the algorithms, understand them, implement them!  (^) Many are math-intensive  (^) Wide variety of algorithms to cover: learning how to write classifiers doesn’t help you write game AI  (^) Find someone else’s code and integrate it  (^) All the usual problems of dealing with the idiosyncrasies of others’ code, Jython integration issues (a la Swing’s weirdness), etc.

Another Approach: Exploiting

Human Intelligence

 (^) There’s a lot of knowledge out there already  (^) Some of it is encoded in a way that machines can make sense of it  (^) If you’re really clever, you may be able to get people to help out directly  (^) Why? Humans are generally smarter than machines “Computers are worthless. They can only give you answers.”

  • Pablo Picasso “Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant.”
  • Albert Einstein

The ESP Game

 (^) Two player web-based game  (^) You are randomly paired with an online partner  (^) Both see the same image  (^) Goal is to guess what your partner is typing about the image  (^) As soon as a guess of yours is equal to a guess that your partner has made you get a new image  (^) “Taboo words” can’t be used  (^) You get points each time you agree with your partner; number of points depends on number of taboo words  (^) More taboo words -> harder to guess -> more points

Behind the Scenes

 (^) Guise: moderately entertaining game  (^) Real goal: label all images on the web  (^) Provide a textual search engine for images  Provide meaningful alternative text to visually impaired users  (^) The ESP game is a front end to image tagging  (^) Annotate images with terms that describe them  (^) Human-provided information is more accurate, richer, more subtle than machine analysis of the image  (^) Most approaches don’t even do this: rely on text in tags  (^) Taboo words are words tags that have already been found  (^) System rewards refinement of tags with more points  (^) Already collected 7M labels for approximately 3M images  (^) Doing this is more an art than a science, but it’s way cool...

Example

 (^) Through the act of buying, people express their preferences, tastes, opinions  (^) Amazon has mountains of this data  (^) Not just who has bought what  (^) Similarities between books  (^) Confluences of interest among book buyers  (^) All of this encoded into the Amazon website, waiting to be used  (^) How might you use it?  (^) Social networking applications?  (^) Suggest dating opportunities based on overlap of Amazon recommendation lists?  (^) Visualize degree-of-separation between people, based on similarities of their book tastes?

Example

 (^) People are very good at separating the wheat from the chaff when it comes to browsing web pages  (^) Some you consider authoritative, fun, etc., and may check on a day-by- day basis  Some you may link to yourself  (^) Google knows how people rate pages on the web, by calculating how many people link to certain pages: PageRank algorithm  (^) Hard-core algorithmic work running on their servers...but results are sitting around, waiting for you to reap  (^) How might you use it?  (^) Build an app that provides easy access to authoritative information around you  (^) Example: ubicomp application that, as I walk around the city, gives me top-ranked info on the business I’m nearest (”how good is this restaurant?”)

Extracting Information from the

Web

 (^) Can be really really painful Mining nice looking page: Means parsing this:

Strategies

 (^) Some web sites try to make this easier for you http://en.wikipedia.org/wiki/jython http://en.wikipedia.org/wiki/jython? action=raw

Example (Simple) DOM Usage

 (^) httpunit: http://httpunit.sourceforge.net import com.meterware.httpunit as httpunit import sys class Test: def init(self, url): wc = httpunit.WebConversation() req = httpunit.GetMethodWebRequest(url) resp = wc.getResponse(req) page = wc.getCurrentPage() images = page.getImages() forms = page.getForms() links = page.getLinks() print "---- Images ----" for i in images: if i.link != None: print i.name, "(", i.link.getURLString(), ")" print "---- Forms ----" for f in forms: print f.action print "---- Links ----" for l in links: print l.text, "(", l.getURLString(), ")" if name == "main": t = Test(sys.argv[1])

A Strategy Recap

 (^) So far we have two strategies:  (^) Either get the site to return the least information possible (a la Wikipedia), and then parse it  (^) Or, get ready to do some heavy-duty HTML parsing (perhaps with the assistance of one of the many DOM libraries)  (^) Why so hard?  (^) Largely a mismatch in goals:  (^) The web is designed to provide information to people, not programs  Writing a program to extract information from web content (as opposed to web structure) is both hard and fragile  (^) Is there an equivalent of the web designed for programs , not people?

Other Uses for Web Services:

Alternative UIs

 (^) Piranha Pricecheck: customized Amazon UI for smart phones  (^) Access reviews, deals, etc., faster than wireless web

Other Uses for Web Services:

Alternative UIs

 (^) Delicious Library: uses Amazon as a back-end data source for personal book/CD/DVD catalogs