Similarity Joins for Strings and Sets William Cohen.

Slides:



Advertisements
Similar presentations
Constraint Optimization Presentation by Nathan Stender Chapter 13 of Constraint Processing by Rina Dechter 3/25/20131Constraint Optimization.
Advertisements

Artificial Intelligence Chapter 9 Heuristic Search Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
1 Tree Searching Strategies Updated: 2010/12/27. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these.
CSE 380 – Computer Game Programming Pathfinding AI
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
CS171 Introduction to Computer Science II Graphs Strike Back.
Best-First Search: Agendas
Using Machine Learning to Discover and Understand Structured Data William W. Cohen Machine Learning Dept. and Language Technologies Inst. School of Computer.
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
Review: Search problem formulation
Branch and Bound Searching Strategies
Using Search in Problem Solving
Integration of Heterogeneous Databases without Common Domains Using Queries Based on Textual Similarity: William W. Cohen Machine Learning Dept. and Language.
1 Tree Searching Strategies. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these problems becomes a tree.
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Problem Solving and Search in AI Heuristic Search
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
CPSC 322, Lecture 8Slide 1 Heuristic Search: BestFS and A * Computer Science cpsc322, Lecture 8 (Textbook Chpt 3.5) January, 21, 2009.
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
Monotonicity Admissible Search: “That finds the shortest path to the Goal” Monotonicity: local admissibility is called MONOTONICITY This property ensures.
1 Tree Searching Strategies. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these problems becomes a tree.
CS 188: Artificial Intelligence Fall 2006 Lecture 17: Bayes Nets III 10/26/2006 Dan Klein – UC Berkeley.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Breadth-first search (BFS) 8-puzzle problem The breadth-first search uses a queue to hold all expanded nodes.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Heuristic Search Heuristic - a “rule of thumb” used to help guide search often, something learned experientially and recalled when needed Heuristic Function.
Informed Search Methods
In the once upon a time days of the First Age of Magic, the prudent sorcerer regarded his own true name as his most valued possession but also the greatest.
Informed Search Idea: be smart about what paths to try.
Distance functions and IE -2 William W. Cohen CALD.
In the once upon a time days of the First Age of Magic, the prudent sorcerer regarded his own true name as his most valued possession but also the greatest.
Informed Search Strategies
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
1 Game AI Path Finding. A Common Situation of Game AI A Common Situation of Game AI Path Planning Path Planning –From a start position to a destination.
WAES 3308 Numerical Methods for AI
A Summary of XISS and Index Fabric Ho Wai Shing. Contents Definition of Terms XISS (Li and Moon, VLDB2001) Numbering Scheme Indices Stored Join Algorithms.
WHIRL – summary of results. WHIRL project ( ) WHIRL initiated when at AT&T Bell Labs AT&T Research AT&T Labs - Research AT&T.
In the once upon a time days of the First Age of Magic, the prudent sorcerer regarded his own true name as his most valued possession but also the greatest.
Informed (Heuristic) Search
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Blocking. Basic idea: – heuristically find candidate pairs that are likely to be similar – only compare candidates, not all pairs Variant 1: – pick some.
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
CS 3343: Analysis of Algorithms Lecture 18: More Examples on Dynamic Programming.
In the once upon a time days of the First Age of Magic, the prudent sorcerer regarded his own true name as his most valued possession but also the greatest.
Heuristic Search Foundations of Artificial Intelligence.
Today’s Topics Exam Thursday Oct 22. 5:30-7:3-pm, same room as lecture Makeup Thursday Oct 29? Or that Monday or Wednesday? Exam Covers Material through.
Honors Track: Competitive Programming & Problem Solving Finding your way with A*-algorithm Patrick Shaw.
Branch and Bound Searching Strategies
Brian Williams, Fall 041 Analysis of Uninformed Search Methods Brian C. Williams Sep 21 st, 2004 Slides adapted from: Tomas Lozano Perez,
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
CSE 326: Data Structures Lecture #17 Heuristic Graph Search Henry Kautz Winter Quarter 2002.
Distance functions and IE - 3 William W. Cohen CALD.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung.
An Efficient Algorithm for Incremental Update of Concept space
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
WHIRL – Reasoning with IE output
Informed search algorithms
WHIRL – Reasoning with IE output
State-Space Searches.
State-Space Searches.
The Rich/Knight Implementation
State-Space Searches.
The Rich/Knight Implementation
Presentation transcript:

Similarity Joins for Strings and Sets William Cohen

SELECT R.a,S.a,S.b,T.b FROM R,S,T WHERE R.a=S.a and S.b=T.b WHIRL approach:

Link items as needed by Q WHIRL approach: Query Q SELECT R.a,S.a,S.b,T.b FROM R,S,T WHERE R.a~S.a and S.b~T.b (~ TFIDF-similar) R.aS.aS.bT.b Anhai Doan Dan Weld Incrementally produce a ranked list of possible links, with “best matches” first. User (or downstream process) decides how much of the list to generate and examine. WilliamWillCohenCohn SteveStevenMintonMitton WilliamDavidCohenCohn

WHIRL queries Assume two relations: review(movieTitle,reviewText): archive of reviews listing(theatre, movieTitle, showTimes, …): now showing The Hitchhiker’s Guide to the Galaxy, 2005 This is a faithful re-creation of the original radio series – not surprisingly, as Adams wrote the screenplay …. Men in Black, 1997 Will Smith does an excellent job in this … Space Balls, 1987 Only a die-hard Mel Brooks fan could claim to enjoy … …… Star Wars Episode III The Senator Theater 1:00, 4:15, & 7:30pm. Cinderella Man The Rotunda Cinema 1:00, 4:30, & 7:30pm. ………

WHIRL queries “Find reviews of sci-fi comedies [movie domain] FROM review SELECT * WHERE r.text~’sci fi comedy’ (like standard ranked retrieval of “sci-fi comedy”) “ “Where is [that sci-fi comedy] playing?” FROM review as r, LISTING as s, SELECT * WHERE r.title~s.title and r.text~’sci fi comedy’ (best answers: titles are similar to each other – e.g., “Hitchhiker’s Guide to the Galaxy” and “The Hitchhiker’s Guide to the Galaxy, 2005” and the review text is similar to “sci-fi comedy”)

WHIRL queries Similarity is based on TFIDF  rare words are most important. Search for high-ranking answers uses inverted indices…. The Hitchhiker ’s Guide to the Galaxy, 2005 Men in Black, 1997 Space Balls, 1987 … Star Wars Episode III Hitchhiker ’s Guide to the Galaxy Cinderella Man … Years are common in the review archive, so have low weight hitchhikermovie00137 themovie001,movie003,movie007,movie008, movie013,movie018,movie023,movie0031, ….. - It is easy to find the (few) items that match on “ important ” terms - Search for strong matches can prune “unimportant terms”

A* (best-first) search Find shortest path between start n 0 and goal n g :goal(n g ) – Define f(n) = g(n) + h(n) g(n) = MinPathLength(n 0,n)| h(n) = estimate of path length from n to n g – Algorithm: OPEN= {n 0 } While OPEN is not empty: – remove “best” (minimal f) node n from OPEN – if goal(n), output path n 0  n and stop – otherwise, add CHILDREN(n) to OPEN » and record their MinPathLength parents

empty circles = open set, filled = closed set; color = distance from the start (the greener, the further)

A* (best-first) search Find shortest path between start n 0 and goal n g :goal(n g ) – Define f(n) = g(n) + h(n) g(n) = MinPathLength(n 0,n)| h(n) = lower-bound of path length from n to n g – Algorithm: OPEN= {n 0 } While OPEN is not empty: – remove “best” (minimal f) node n from OPEN – if goal(n), output path n 0  n and stop – otherwise, add CHILDREN(n) to OPEN » and record their MinPathLength parents » …note this is easy for a tree h is “admissible” and A* will always return the lowest-cost path

A* (best-first) search for best K paths Find shortest path between start n 0 and goal n g :goal(n g ) – Define f(n) = g(n) + h(n) g(n) = MinPathLength(n 0,n)| h(n) = lower-bound of path length from n to n g – Algorithm: OPEN= {n 0 } While OPEN is not empty: – remove “best” (minimal f) node n from OPEN – if goal(n), output path n 0  n » and stop if you’ve output K answers – otherwise, add CHILDREN(n) to OPEN » and record their MinPathLength parents » …note this is easy for a tree h is “admissible” and A* will always return the K lowest-cost paths

Inference in WHIRL “Best-first” search: pick state s that is “best” according to f(s) Suppose graph is a tree, and for all s, s’, if s’ is reachable from s then f(s)>=f(s’). Then A* outputs the globally best goal state s* first, and then next best,...

Using A* For WHIRL Queries Assume two relations: review(movieTitle,reviewText): archive of reviews listing(theatre, movieTitle, showTimes, …): now showing The Hitchhiker’s Guide to the Galaxy, 2005 This is a faithful re-creation of the original radio series – not surprisingly, as Adams wrote the screenplay …. Men in Black, 1997 Will Smith does an excellent job in this … Space Balls, 1987 Only a die-hard Mel Brooks fan could claim to enjoy … …… Star Wars Episode III The Senator Theater 1:00, 4:15, & 7:30pm. Cinderella Man The Rotunda Cinema 1:00, 4:30, & 7:30pm. ………

A* search to solve WHIRL queries “Find reviews of sci-fi comedies [movie domain] FROM review SELECT * WHERE r.text~’sci fi comedy’ “ “Where is [that sci-fi comedy] playing?” FROM review as r, LISTING as s, SELECT * WHERE r.title~s.title and r.text~’sci fi comedy’ (best answers: titles are similar to each other – e.g., “Hitchhiker’s Guide to the Galaxy” and “The Hitchhiker’s Guide to the Galaxy, 2005” and the review text is similar to “sci-fi comedy”) review(Title,Text), Text ~ “sci fi comedy” review(Title,Text), Text ~ “sci fi comedy” review(TitleA,Text), listing( TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB review(TitleA,Text), listing( TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB Answer to Q is an assignment Θ to all the variables in Q

Using A* For WHIRL Queries Menace II Society, 1993 In this urban crime drama, directed by twin brothers Allen and Albert Hughes, a young street hustler … Men in Black, 1997 Will Smith does an excellent job in this campy sci-fi. With Jones playing straight man this comedy succeeds in … Men in Tights, 1988 Only a die-hard Mel Brooks fan could claim to enjoy … …… The Kings Speech Impediment The Senator Theater 1:00, 4:15, & 7:30pm. Hunger Games The Rotunda Cinema 1:00, 4:30, & 7:30pm. Men In Black 3 Leows Water Front 7:00 pm review(TitleA,Text), listing(Where, TitleB,When), Text ~ “sci fi comedy”, TitleA ~ TitleB review(TitleA,Text), listing(Where, TitleB,When), Text ~ “sci fi comedy”, TitleA ~ TitleB

Using A* For WHIRL Queries Menace II Society, 1993 In this urban crime drama, directed by twin brothers Allen and Albert Hughes, a young street hustler … Men in Black, 1997 Will Smith does an excellent job in this campy sci-fi. With Jones playing straight man this comedy succeeds in … Men in Tights, 1988 Only a die-hard Mel Brooks fan could claim to enjoy … …… The Black Stallion - Director’s Cut The Senator 1:00, 4:15, & 7:30pm. Hunger Games The Rotunda Cinema 1:00, 4:30, & 7:30pm. Men In Black 3 Leows Water Front 7:00 pm review(TitleA,Text), listing(TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB review(TitleA,Text), listing(TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB

Using A* For WHIRL Queries Menace II Society, 1993 In this urban crime drama, directed by twin brothers Allen and Albert Hughes, a young street hustler … Men in Black, 1997 Will Smith does an excellent job in this campy sci-fi. With Jones playing straight man this comedy succeeds in … Men in Tights, 1988 Only a die-hard Mel Brooks fan could claim to enjoy … …… The Black Stallion - Director’s Cut The Senator 1:00, 4:15, & 7:30pm. Hunger Games The Rotunda Cinema 1:00, 4:30, & 7:30pm. Men In Black 3 Leows Water Front 7:00 pm review(TitleA,Text), listing(TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB review(TitleA,Text), listing(TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB

Using A* For WHIRL Queries Menace II Society, 1993 In this urban crime drama, directed by twin brothers Allen and Albert Hughes, a young street hustler … Men in Black, 1997 Will Smith does an excellent job in this campy sci-fi. With Jones playing straight man this comedy succeeds in … Men in Tights, 1988 Only a die-hard Mel Brooks fan could claim to enjoy … …… The Black Stallion - Director’s Cut The Senator 1:00, 4:15, & 7:30pm. Hunger Games The Rotunda Cinema 1:00, 4:30, & 7:30pm. Men In Black 3 Leows Water Front 7:00 pm review(TitleA,Text), listing(TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB review(TitleA,Text), listing(TitleB,Where,When), Text ~ “sci fi comedy”, TitleA ~ TitleB

A* (best-first) search for best K paths Find shortest path between start n 0 and goal n g :goal(n g ) – Define f(n) = g(n) + h(n) g(n) = MinPathLength(n 0,n)| h(n) = lower-bound of path length from n to n g – Algorithm: OPEN= {n 0 }, where n 0 is an empty assignment to variables While OPEN is not empty: – remove “best” (minimal f) node n from OPEN – if goal(n), output path n 0  n » and stop if you’ve output K answers – otherwise, add CHILDREN(n) to OPEN » where CHILDREN(n) binds a few more variables

A* (best-first) search for best K paths Find shortest path between start n 0 and goal n g :allVarsBound(n g ) – Define f(n) = g(n) + h(n) g(n) = MinPathLength(n 0,n)| h(n) = lower-bound of path length from n to n g – Algorithm: OPEN= {n 0 }, where n 0 is an empty assignment to variables While OPEN is not empty: – remove “best” (minimal f) node n from OPEN – if allVarsBound(n), output path n 0  n » and stop if you’ve output K answers – otherwise, add CHILDREN(n) to OPEN » where CHILDREN(n) binds a few more variables

A* (best-first) search for best K paths Find shortest path between start n 0 and goal n g :allVarsBound(n g ) – Define f(n) = g(n) + h(n) g(n) = MinPathLength(n 0,n)| h(n) = lower-bound of path length from n to n g – Algorithm: OPEN= {n 0 }, where n 0 is an empty assignment θ and an empty “exclusion list” E While OPEN is not empty: – remove “best” (minimal f) node n from OPEN – if allVarsBound(n), output path n 0  n » and stop if you’ve output K answers – otherwise, add CHILDREN(n) to OPEN » where CHILDREN(n) binds a few more variables

Inference in WHIRL Explode p(X1,X2,X3): find all DB tuples for p and bind Xi to ai. Constrain X~Y: if X is bound to a and Y is unbound, –find DB column C to which Y should be bound –pick a term t in X, find proper inverted index for t in C, and bind Y to something in that index Keep track of t’s used previously, and don’t allow Y to contain one.

Inference in WHIRL Adding to exclusions E means that upper bound h decreases Looking at maxweight means that partial assignments that can’t match well are penalized Adding to exclusions E means that upper bound h decreases Looking at maxweight means that partial assignments that can’t match well are penalized

Aside: Why WHIRL’s query language was cool Combination of cascading queries and getting top-k answers is very useful – Highly selective queries: system can apply lots of constraints user can pick from a small set of well-constrained potential answers – Very broad queries: system can cherry-pick and get the easiest/most obvious answers most of what the user sees is correct Similar to joint inference schemes Can handle lots of problems – classification,

Epilogue A few followup query systems to WHIRL – ELIXIR, iSPARQL, … “Joint inference” trick mostly ignored – and/or rediscovered over and over Lots and lots of work on similarity/distance metrics and efficient similarity joins – much of which rediscovers A*-like tricks

Outline Why joins are important Why similarity joins are important Useful similarity metrics for sets and strings Fast methods for K-NN and similarity joins – Blocking – Indexing – Short-cut algorithms – Parallel implementation