Boolean Retrieval PPT Updated
Boolean Retrieval PPT Updated
Introduction to
Information Retrieval
Introduction to Information Retrieval
Information Retrieval
Information Retrieval (IR) is finding material (usually
documents) of an unstructured nature (usually text)
that satisfies an information need from within large
collections (usually stored on computers).
2
Introduction to Information Retrieval
Boolean Retrieval
Boolean retrieval model is model for informtion retrieval in which we can pose
many query which is in the form of boolean expressions of terms, that is, in which
term combined with the operators AND,OR,and NOT
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 those
containing Calpurnia?
Incidence vectors
So we have a 0/1 vector for each term.
5
Introduction to Information Retrieval
Answers to query
Answer 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.
6
Introduction to Information Retrieval
7
Introduction to Information Retrieval
8
Introduction to Information Retrieval
Bigger collections
Consider N = 1 million documents, each with about 1000
words.
9
Introduction to Information Retrieval
10
Introduction to Information Retrieval
Inverted index
For each term t, we must store a list of all documents
that contain t.
Identify each by a docID, a document serial number
Can we used fixed-size arrays for this?
Inverted index
We need variable-size postings lists
On disk, a continuous run of postings is normal and best
In memory, can use linked lists or variable length arrays
Some tradeoffs in size/ease of insertion Posting
Tokenizer
Token stream. Friends Romans Countrymen
Linguistic
modules
Modified tokens. friend roman countryman
Indexer friend 2 4
roman 1 2
Inverted index.
countryman 13 16
Introduction to Information Retrieval
Doc 1 Doc 2
Terms
and
counts
Pointers 17
Introduction to Information Retrieval
18
Introduction to Information Retrieval
2 4 8 16 32 64 128 Brutus
1 2 3 5 8 13 21 34 Caesar
19
Introduction to Information Retrieval
The merge
Walk through the two postings simultaneously, in
time linear in the total number of postings entries
2 4 8 16 32 64 128 Brutus
2 8
1 2 3 5 8 13 21 34 Caesar
21
Introduction to Information Retrieval
Query processing: OR
Implementation (brutus OR calpurnia)
2 4 8 16 32 64 128 Brutus
1 2 3 5 8 13 21 34 Caesar
22
Introduction to Information Retrieval
23
Introduction to Information Retrieval
Query optimization
Brutus 2 4 8 16 32 64 128
Caesar 1 2 3 5 8 16 21 34
Calpurnia 13 16
Brutus 2 4 8 16 32 64 128
Caesar 1 2 3 5 8 16 21 34
Calpurnia 13 16
28
Introduction to Information Retrieval
Exercise
Recommend a query
processing order for
Term Freq
(tangerine OR trees) AND eyes 213312
(marmalade OR skies) AND kaleidoscope 87009
(kaleidoscope OR eyes) marmalade 107913
skies 271658
tangerine 46653
trees 316812
29
Introduction to Information Retrieval
31
Introduction to Information Retrieval
32
Introduction to Information Retrieval
33