CS315 Introduction to Information Retrieval Boolean Search 1.

Slides:



Advertisements
Similar presentations
Advanced topics in Computer Science Jiaheng Lu Department of Computer Science Renmin University of China
Advertisements

Introduction to Information Retrieval Introduction to Information Retrieval Hinrich Schütze and Christina Lioma Lecture 1: Boolean Retrieval 1.
CS276A Text Retrieval and Mining Lecture 1. Query Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? One could grep all.
Adapted from Information Retrieval and Web Search
Srihari-CSE535-Spring2008 CSE 535 Information Retrieval Lecture 2: Boolean Retrieval Model.
Boolean Retrieval Lecture 2: Boolean Retrieval Web Search and Mining.
Introduction to Information Retrieval Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
CpSc 881: Information Retrieval
1 Boolean and Vector Space Retrieval Models Many slides in this section are adapted from Prof Raymond Mooney (UTexas), Prof. Joydeep Ghosh (UT ECE) who.
Information Retrieval
CS276 Information Retrieval and Web Search Lecture 1: Boolean retrieval.
Introduction to IR Systems: Supporting Boolean Text Search 198:541.
Information Retrieval using the Boolean Model. Query Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? Could grep all.
Srihari-CSE535-Spring2008 CSE 535 Information Retrieval Chapter 1: Introduction to IR.
1 CSCI 5417 Information Retrieval Systems Lecture 1 8/23/2011 Introduction.
PrasadL3InvertedIndex1 Inverted Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)
Introducing Information Retrieval and Web Search
Introduction to Information Retrieval Acknowledgements to Pandu Nayak and Prabhakar Raghavan of Stanford, Hinrich Schütze and Christina Lioma of Stutgart,
PrasadL3InvertedIndex1 Inverted Index Construction Adapted from Lectures by Prabhakar Raghavan (Yahoo and Stanford) and Christopher Manning (Stanford)
Introduction to Information Retrieval (Manning, Raghavan, Schutze) Chapter 1 Boolean retrieval.
Information Retrieval and Data Mining (AT71. 07) Comp. Sc. and Inf
Introduction to Information Retrieval Introduction to Information Retrieval cs458 Introduction David Kauchak adapted from:
LIS618 lecture 2 the Boolean model Thomas Krichel
Introduction to Information Retrieval Introduction to Information Retrieval Modified from Stanford CS276 slides Chap. 1: Boolean retrieval.
Modern Information Retrieval Lecture 3: Boolean Retrieval.
Introduction to Information Retrieval Introduction to Information Retrieval COMP4201 Information Retrieval and Search Engines Lecture 1 Boolean retrieval.
Introduction to Information Retrieval Introduction to Information Retrieval Information Retrieval and Web Search Lecture 1: Introduction and Boolean retrieval.
Introduction to Information Retrival Slides are adapted from stanford CS276.
IR Paolo Ferragina Dipartimento di Informatica Università di Pisa.
ITCS 6265 IR & Web Mining ITCS 6265/8265: Advanced Topics in KDD --- Information Retrieval and Web Mining Lecture 1 Boolean retrieval UNC Charlotte, Fall.
Text Retrieval and Text Databases Based on Christopher and Raghavan’s slides.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Pandu Nayak and Prabhakar Raghavan.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Christopher Manning and Prabhakar.
CES 514 – Data Mining Lec 2, Feb 10 Spring 2010 Sonoma State University.
1 CS276 Information Retrieval and Web Search Lecture 1: Introduction.
Introduction to Information Retrieval CSE 538 MRS BOOK – CHAPTER I Boolean Model 1.
Information Retrieval Lecture 1. Query Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? Could grep all of Shakespeare’s.
Introduction to Information Retrieval Introduction to Information Retrieval CS276 Information Retrieval and Web Search Christopher Manning and Prabhakar.
1 Information Retrieval Tanveer J Siddiqui J K Institute of Applied Physics & Technology University of Allahabad.
1. L01: Corpuses, Terms and Search Basic terminology The need for unstructured text search Boolean Retrieval Model Algorithms for compressing data Algorithms.
1 Information Retrieval LECTURE 1 : Introduction.
Introduction to Information Retrieval Introduction to Information Retrieval Modified from Stanford CS276 slides Chap. 1: Boolean retrieval.
Introduction to Information Retrieval Introduction to Information Retrieval cs160 Introduction David Kauchak adapted from:
Introduction to Information Retrieval Boolean Retrieval.
CS276 Information Retrieval and Web Search Lecture 1: Boolean retrieval.
Introduction to Information Retrieval Introduction to Information Retrieval Lecture 1: Boolean retrieval.
Information Retrieval and Web Search Boolean retrieval Instructor: Rada Mihalcea (Note: some of the slides in this set have been adapted from a course.
Web Information Retrieval Textbook by Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schutze Notes Revised by X. Meng for SEU May 2014.
Introduction to Information Retrieval Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
Introduction to Information Retrieval Introducing Information Retrieval and Web Search.
Module 2: Boolean retrieval. Introduction to Information Retrieval Information Retrieval  Information Retrieval (IR) is finding material (usually documents)
CS 6633 資訊檢索 Information Retrieval and Web Search Lecture 1: Boolean retrieval Based on a ppt file by HinrichSchütze.
Web-based Information Architecture 01: Boolean Retrieval Hongfei Yan School of EECS, Peking University 2/27/2013.
Take-away Administrativa
Information Retrieval : Intro
Large Scale Search: Inverted Index, etc.
CS122B: Projects in Databases and Web Applications Winter 2017
COIS 442 Foundations on IR Information Retrieval and Web Search
Slides from Book: Christopher D
Modified by Dongwon Lee from slides by
정보 검색 특론 Information Retrieval and Web Search
Boolean Retrieval.
Information Retrieval and Data Mining (AT71. 07) Comp. Sc. and Inf
Boolean Retrieval.
Information Retrieval and Web Search Lecture 1: Boolean retrieval
Information Retrieval
Boolean Retrieval.
CS276 Information Retrieval and Web Search
Introducing Information Retrieval and Web Search
Inverted Index Construction
Presentation transcript:

CS315 Introduction to Information Retrieval Boolean Search 1

Intro to IR, Boolean Search Basic terminology The need for unstructured text search Boolean Retrieval Model Algorithms for compressing data Algorithms for answering Boolean queries Read Chapter 1 of MRS

Information Retrieval (IR) Finding material (usually documents) of an unstructured nature (usually text) that satisfies an information need from within large collections (usually stored on computers). 3

Unstructured (text) vs. structured (database) data

Unstructured (text) vs. structured (database) data

Unstructured Data in 1680 You have all the Shakespeare plays stored in files Which plays contain the word Caesar? Your algorithm here: Which plays of Shakespeare contain the words Brutus AND Caesar ?

Processing unstructured data Which plays of Shakespeare contain the words Brutus AND Caesar but NOT Calpurnia? One could grep all of Shakespeare’s plays for Brutus and Caesar, then strip out lines containing Calpurnia, but… It Is Slow! (for large corpora) Computing NOT Calpurnia is non-trivial Other operations not feasible (e.g., find Romans near countrymen) Ranked retrieval (find “best” documents to return) also not possible 7

“Term-document incidence” matrix 8 1 if file contains word, 0 otherwise Brutus AND Caesar but NOT Calpurnia N documents m terms

Incidence vectors So we have a 0/1 binary vector for each term How do you answer the query?. Take the vectors for Brutus, Caesar and (complement) Calpurnia  bitwise AND AND AND  N documents m terms Brutus AND Caesar but NOT Calpurnia

Answers to query Antony and Cleopatra, Act III, Scene ii Agrippa [Aside to DOMITIUS ENOBARBUS]: Why, Enobarbus, When Antony found Julius Caesar dead, He cried almost to roaring; and he wept When at Philippi he found Brutus slain. Hamlet, Act III, Scene ii Lord Polonius: I did enact Julius Caesar I was killed i' the Capitol; Brutus killed me. 10 Sec. 1.1

How good are the retrieved docs?  Precision: Fraction of retrieved docs that are relevant to user’s information need  Recall : Fraction of relevant docs in collection that are retrieved  More precise definitions and measurements to follow in later lectures  For now, let’s focus on the techniques of retrieval 11 Sec. 1.1

Space requirements Say, N = 1M documents, each with about 1K terms. How many terms in all documents (corpus)? Average 6 bytes/term including spaces/punctuation. How many GB of data in corpus? 12 N documents m terms

Does the matrix fits in memory? Say there are m = 500K distinct terms among these. How many 0’s and 1’s in the Term-doc incidence matrix? 500K x 1M matrix has 500 Billion 0’s and 1’s. But matrix is extremely sparse it has no more than 1 Billion 1’s. What if we only record the 1 positions. What is a better representation than a matrix? 13 Why? N=1mil documents m=0.5mil distinct terms

“Inverted” Index For each term T, we must store a listing of all document id’s that contain T. Do we use an array or a linked list for this? 14 Brutus Calpurnia Caesar What happens if the word Caesar is added to document 14?

Inverted index Linked lists generally preferred to arrays + Dynamic space allocation + Insertion of terms into documents easy – Space overhead of pointers 15 Brutus Calpurnia Caesar Dictionary Postings lists Sorted by docID Posting

Inverted index construction 16 Tokenizer Token stream. Friends Romanscountrymen Linguistic modules Modified tokens. friend romancountryman Indexer Inverted index. friend roman countryman More on these later. Documents to be indexed. Friends, Romans, countrymen.

Indexer step 1: Token sequence INPUT: Sequence of pairs: (Modified token, Document ID) 17 I did enact Julius Caesar I was killed i' the Capitol; Brutus killed me. Doc 1 So let it be with Caesar. The noble Brutus hath told you Caesar was ambitious Doc 2

Indexer step 2: Sort Sort by terms. Then by docID 18 Core indexing step.

Indexer step 3: Dictionary & Postings Merge multiple term entries in a single document Note two entries for caesar! We merge PER DOCUMENT. Add frequency information. 19 Why frequency? Will discuss later. DictionaryPostings

We just built an index… How do we process a query? For later: what kinds of queries can we process? 20 Today’s focus Sec. 1.3

Query processing w/ inverted index: AND Consider processing the query: Brutus AND Caesar Locate Brutus in the Dictionary;  Retrieve its postings. Locate Caesar in the Dictionary;  Retrieve its postings. “Intersect” the two postings: Brutus Caesar

The Intersection (“merging”) Walk through the two postings simultaneously. Time complexity? _______ in the total number of postings entries Brutus Caesar 2 8 If the list lengths are x and y, the merge takes O(x+y) operations. Crucial: postings sorted by docID.

Intersecting two postings lists 23

Boolean queries: Exact match The Boolean retrieval model is being able to ask a query that is a Boolean expression: Boolean Queries use AND, OR and NOT to join query terms  Views each document as a set of words  Is precise: document matches condition or not. Perhaps the simplest model to build an IR system on Primary commercial retrieval tool for 3 decades. Many search systems you still use are Boolean: , library catalog, Mac OS X Spotlight 24 Sec. 1.3

Query Optimization What’s the best order for processing pairs of postings? (Brutus AND Calpurnia) AND Caesar (Calpurnia AND Caesar) AND Brutus (Brutus AND Caesar) AND Calpurnia 25 Query: Brutus AND Calpurnia AND Caesar Brutus Calpurnia Caesar

Query optimization example Process in order of increasing frequency: start with smallest set, then keep cutting further. 26 Brutus Calpurnia Caesar This is why we kept freq in dictionary Execute the query as (Caesar AND Brutus) AND Calpurnia. Query: Brutus AND Calpurnia AND Caesar

More General Optimization Query: (madding OR crowd) AND (ignoble OR strife) Get freq’s for all terms. Estimate the size of each OR by the sum of its freq’s (conservative). Process in increasing order of OR sizes. 27