CPSC 404 Laks V.S. Lakshmanan1 Introduction to IR Systems: Supporting Boolean Text Search Ramakrishnan & Gehrke: Chapter 27, Sections 27.1—27.2.

Slides:



Advertisements
Similar presentations
Information Retrieval in Practice
Advertisements

Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Overview of Query Evaluation (contd.) Chapter 12 Ramakrishnan and Gehrke (Sections )
IMPLEMENTATION OF INFORMATION RETRIEVAL SYSTEMS VIA RDBMS.
Chapter 5: Introduction to Information Retrieval
Evaluation of Relational Operators CS634 Lecture 11, Mar Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Crawling, Ranking and Indexing. Organizing the Web The Web is big. Really big. –Over 3 billion pages, just in the indexable Web The Web is dynamic Problems:
Introduction to Information Retrieval
Database Management Systems 3ed, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 14, Part B.
Implementation of Other Relational Algebra Operators, R. Ramakrishnan and J. Gehrke1 Implementation of other Relational Algebra Operators Chapter 12.
Database Management Systems, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 12, Part B.
Lucene Part3‏. Lucene High Level Infrastructure When you look at building your search solution, you often find that the process is split into two main.
Web- and Multimedia-based Information Systems. Assessment Presentation Programming Assignment.
Information Retrieval in Practice
I NTRODUCTION TO IR S YSTEMS : S EARCH E NGINES Chapter 27.
Elementary IR Systems: Supporting Boolean Text Search.
Introduction to IR Systems: Supporting Boolean Text Search
Elementary IR Systems: Supporting Boolean Text Search.
Introduction to IR Systems: Supporting Boolean Text Search 198:541.
Database Management Systems, R. Ramakrishnan1 Introduction to IR Systems: Supporting Boolean Text Search Chapter 27, Part A.
Elementary IR: Scalable Boolean Text Search (Compare with R & G )
Information retrieval Finding relevant data using irrelevant keys Example: database of photographic images sorted by number, date. DBMS: Well structured.
CS194-3/CS16x Introduction to Systems Lecture 26 Elementary Information Retrieval: Scalable Boolean Text Search December 3, 2007 Prof. Anthony D. Joseph.
1 Evaluation of Relational Operations: Other Techniques Chapter 12, Part B.
1 External Sorting for Query Processing Yanlei Diao UMass Amherst Feb 27, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Web Search – Summer Term 2006 II. Information Retrieval (Basics) (c) Wolfgang Hürst, Albert-Ludwigs-University.
1 CS 502: Computing Methods for Digital Libraries Lecture 11 Information Retrieval I.
Chapter 5: Information Retrieval and Web Search
Overview of Search Engines
Practical Database Design and Tuning. Outline  Practical Database Design and Tuning Physical Database Design in Relational Databases An Overview of Database.
Chapter 2 CIS Sungchul Hong
CS6530 Graduate-level Database Systems Prof. Feifei Li.
 DATABASE DATABASE  DATABASE ENVIRONMENT DATABASE ENVIRONMENT  WHY STUDY DATABASE WHY STUDY DATABASE  DBMS & ITS FUNCTIONS DBMS & ITS FUNCTIONS 
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
DANIEL J. ABADI, ADAM MARCUS, SAMUEL R. MADDEN, AND KATE HOLLENBACH THE VLDB JOURNAL. SW-Store: a vertically partitioned DBMS for Semantic Web data.
Chapter 2 Architecture of a Search Engine. Search Engine Architecture n A software architecture consists of software components, the interfaces provided.
CSE 6331 © Leonidas Fegaras Information Retrieval 1 Information Retrieval and Web Search Engines Leonidas Fegaras.
CPSC 404, Laks V.S. Lakshmanan1 Evaluation of Relational Operations: Other Operations Chapter 14 Ramakrishnan & Gehrke (Sections ; )
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 13.
Chapter 6: Information Retrieval and Web Search
Introduction to Digital Libraries hussein suleman uct cs honours 2003.
CS370 Spring 2007 CS 370 Database Systems Lecture 1 Overview of Database Systems.
The Anatomy of a Large-Scale Hyper textual Web Search Engine S. Brin, L. Page Presenter :- Abhishek Taneja.
CPSC 404, Laks V.S. Lakshmanan1 External Sorting Chapter 13: Ramakrishnan & Gherke and Chapter 2.3: Garcia-Molina et al.
CPSC 404, Laks V.S. Lakshmanan1 Evaluation of Relational Operations – Join Chapter 14 Ramakrishnan and Gehrke (Section 14.4)
1 Introduction to IR Systems: Supporting Boolean Text Search.
Chapter 5 Ranking with Indexes. Indexes and Ranking n Indexes are designed to support search  Faster response time, supports updates n Text search engines.
CS315 Introduction to Information Retrieval Boolean Search 1.
Information Retrieval in Practice
Why indexing? For efficient searching of a document
Information Retrieval in Practice
Module 11: File Structure
Hash-Based Indexes Chapter 11
Elementary IR: Scalable Boolean Text Search
Evaluation of Relational Operations: Other Operations
Chapter 2 Database Environment.
Instructor : Marina Gavrilova
Team Project, Part II NOMO Auto, Part II IST 210 Section 4
Hash-Based Indexes Chapter 10
Selected Topics: External Sorting, Join Algorithms, …
Relational Algebra Chapter 4, Sections 4.1 – 4.2
Introduction to Information Retrieval
Chapter 5: Information Retrieval and Web Search
Implementation of Relational Operations
Evaluation of Relational Operations: Other Techniques
Chapter 11 Instructor: Xin Zhang
Information Retrieval and Web Design
Data Independence Applications insulated from how data is structured and stored. Logical data independence: Protection from changes in logical structure.
Evaluation of Relational Operations: Other Techniques
Presentation transcript:

CPSC 404 Laks V.S. Lakshmanan1 Introduction to IR Systems: Supporting Boolean Text Search Ramakrishnan & Gehrke: Chapter 27, Sections 27.1—27.2

CPSC 404 Laks V.S. Lakshmanan2 Information Retrieval  A research field traditionally separate from Databases Goes back to IBM, Rand and Lockheed in the 50’s G. Salton at Cornell in the 60’s Lots of research since then  DB & IR Products traditionally separate Originally, document management systems for libraries, government, law, etc. Gained prominence in recent years due to web search

CPSC 404 Laks V.S. Lakshmanan3 IR vs. DBMS  Seem like very different beasts:  Both support queries over large datasets, use indexing. In practice, you currently have to choose between the two. Not pleasant! (e.g., docs w/ structure or DB of products with customer reviews (text).  Expect reasonable number of updates Read-Mostly. Add docs occasionally SQLKeyword search Generate all answers top k results Structured dataUnstructured data format Precise SemanticsImprecise Semantics DBMSIR

CPSC 404 Laks V.S. Lakshmanan4 IR’s “Bag of Words” Model  Typical IR data model: Each document is just a bag (multiset) of words (“terms”) Bag models a doc just like a BBox models a spatial object.  Detail 1: “Stop Words” Certain words are considered irrelevant and not placed in the bag e.g., “the” e.g., HTML tags like [not always a good idea!]  Detail 2: “Stemming” and other content analysis Using language-specific rules, convert words to their basic form e.g., “surfing”, “surfed” --> “surf”

CPSC 404 Laks V.S. Lakshmanan5 Boolean Text Search  Find all documents that match a Boolean containment expression: “Windows” AND (“Glass” OR “Door”) AND NOT “Microsoft”  Note: Query terms are also filtered via stemming and stop words.  When web search engines say “10,000 documents found”, that’s the Boolean search result size (subject to a common “max # returned’’ cutoff).

CPSC 404 Laks V.S. Lakshmanan6 Text “Indexes”  When IR folks say “text index”… Usually mean more than what DB people mean  In our terms, both “tables” and indexes Really a logical schema (i.e., tables) With a physical schema (which includes indexes) Tables implemented as files in a file system

CPSC 404 Laks V.S. Lakshmanan7 A Simple Relational Text Index  Create and populate a table InvertedFile(term string, docURL string) [could be any docId instead,] (note similarity to data entries.)  Build a B+-tree or Hash index on InvertedFile.term Alternative 3 ( as entries in index) critical here for efficient storage!! Fancy list compression possible, too Note: URL takes the place of RID, the web is your “heap file”! Can also cache pages and use RIDs (similar to materialized views.)  This is often called an “inverted file” or “inverted index” Maps words -> lists of docs  Can now do single-word text search queries!

CPSC 404 Laks V.S. Lakshmanan8 An Inverted File  Search for “databases” “microsoft”

CPSC 404 Laks V.S. Lakshmanan9 Handling Boolean Logic  How to do “term1” OR “term2”? Union of two DocURL sets!  How to do “term1” AND “term2”? Intersection of two DocURL sets! Can be done by sorting both lists alphabetically and merging the lists  How to do “term1” AND NOT “term2”? Set subtraction, also done via sorting  How to do “term1” OR NOT “term2” Union of “term1” and “NOT term2”. “Not term2” = all docs not containing term2. Large set!! Usually not allowed!  Note similarity to the way we process boolean selection conditions on relations by manipulating RID sets.  Refinement: What order to handle terms if you have many ANDs/NOTs?

CPSC 404 Laks V.S. Lakshmanan10 Boolean Search in SQL  (SELECT docURL FROM InvertedFile WHERE word = “windows” INTERSECT SELECT docURL FROM InvertedFile WHERE word = “glass” OR word = “door”) EXCEPT SELECT docURL FROM InvertedFile WHERE word=“Microsoft” ORDER BY relevance() “Windows” AND (“Glass” OR “Door”) AND NOT “Microsoft”

CPSC 404 Laks V.S. Lakshmanan11 Boolean Search in SQL  Really only one SQL query in Boolean Search IR: Single-table selects, UNION, INTERSECT, EXCEPT  relevance () is the “secret sauce” in the search engines: Combos of statistics, linguistics, and graph theory tricks! [computing reputation of pages, hubs and authorities on topics, etc.] Unfortunately, not easy to compute this efficiently using typical DBMS implementation.

CPSC 404 Laks V.S. Lakshmanan12 Computing Relevance 1/3  Relevance calculation involves how often search terms appear in doc, and how often they appear in collection: More search terms found in doc  doc is more relevant Greater importance attached to finding rare terms (i.e., search terms, rare in the collection, but appear in this doc.).

CPSC 404 Laks V.S. Lakshmanan13 Computing relevance 2/3  Doing this efficiently in current SQL engines is not easy: “Relevance of a doc wrt a search term” is a function that is called once per doc the term appears in (docs found via inv. index): For efficient fn computation, for each term, we can store the # times it appears in each doc, as well as the # docs it appears in. Must also sort retrieved docs by their relevance value. Also, think about Boolean operators (if the search has multiple terms) and how they affect the relevance computation!

CPSC 404 Laks V.S. Lakshmanan14 Computing relevance 3/3  An object-relational or object-oriented DBMS with good support for function calls is better, but you still have long execution path-lengths compared to optimized search engines.

CPSC 404 Laks V.S. Lakshmanan15 Fancier: Phrases and “Near”  Suppose you want a phrase E.g., “Happy Days”  Different schema: InvertedFile (term string, count int, position int, DocURL string) Alternative 3 index on term  Post-process the results Find “Happy” AND “Days” Keep results where positions are 1 off Doing this well is like join processing  Can do a similar thing for “term1” NEAR “term2” Position < k off  What if you had no constraint on k, BUT had to sort based on distance?

CPSC 404 Laks V.S. Lakshmanan16 Updates and Text Search  Text search engines are designed to be query- mostly: Deletes and modifications are rare Can postpone updates (nobody notices, no transactions!) Updates done in batch (rebuild the index) Can’t afford to go off-line for an update? Create a 2nd index on a separate machine Replace the 1st index with the 2nd! So no concurrency control problems Can compress to search-friendly, update-unfriendly format  Main reason why text search engines and DBMSs are usually separate products. Also, text-search engines tune that one SQL query to death!

CPSC 404 Laks V.S. Lakshmanan17 { DBMS vs. Search Engine Architecture The Access Method Buffer Management Disk Space Management OS “The Query” Search String Modifier Simple DBMS } Ranking Algorithm Query Optimization and Execution Relational Operators Files and Access Methods Buffer Management Disk Space Management Concurrency and Recovery Needed DBMSSearch Engine

CPSC 404 Laks V.S. Lakshmanan18 IR vs. DBMS Revisited  Semantic Guarantees DBMS guarantees transactional semantics If inserting Xact commits, a later query will see the update Handles multiple concurrent updates correctly IR systems do not do this; nobody notices! Postpone insertions until convenient No model of correct concurrency  Data Modeling & Query Complexity DBMS supports any schema & queries Requires you to define schema Complex query language hard to learn IR supports only one schema & query No schema design required (unstructured text) Trivial-to-learn query language

CPSC 404 Laks V.S. Lakshmanan19 IR vs. DBMS, Contd.  Performance goals DBMS supports general SELECT plus arbitrarily complex queries Plus mix of INSERT, UPDATE, DELETE General purpose engine must always perform “well” IR systems expect only one stylized SELECT Plus delayed INSERT, unusual DELETE, no UPDATE. Special purpose, must run super-fast on “The Query” Users rarely look at the full answer in Boolean Search

CPSC 404 Laks V.S. Lakshmanan20 Lots More in IR …  How to “rank” the output? I.e., how to compute relevance of each result item w.r.t. the query? Doing this well / efficiently is hard!  Other ways to help users paw through the output? Document “clustering”, document visualization  How to take advantage of hyperlinks? Really cute tricks here! (visibility, authority, page rank, etc.)  How to use compression for better I/O performance? E.g., making RID lists smaller Try to make things fit in RAM!  How to deal with synonyms, misspelling, abbreviations?  How to write a good web crawler?