Introduction to Information Retrieval
Introduction to Information Retrieval
An Introduction
Dr. Grace Hui Yang
InfoSense
Department of Computer Science
Georgetown University, USA
[email protected]
Jan 2019 @ Cape Town 1
A Quick Introduction
• What do we do at InfoSense
• Dynamic Search
• IR and AI
• Privacy and IR
• Today’s lecture is on IR fundamentals
• Textbooks and some of their slides are referenced and used here
• Modern Information Retrieval: The Concepts and Technology behind Search. by Ricardo Baeza-Yates,
Berthier Ribeiro-Neto. Second condition. 2011.
• Introduction to Information Retrieval. C.D. Manning, P. Raghavan, H. Schütze. Cambridge UP, 2008.
• Foundations of Statistical Natural Language Processing. Christopher D. Manning and Hinrich Schütze.
• Search Engines: Information Retrieval in Practice. W. Bruce Croft, Donald Metzler, and Trevor Strohman.
2009.
• Personal views are also presented here
• Especially in the Introduction and Summary sections
2
Outline
• What is Information Retrieval
• Task, Scope, Relations to other disciplines
• Process
• Preprocessing, Indexing, Retrieval, Evaluation, Feedback
• Retrieval Approaches
• Boolean
• Vector Space Model
• BM25
• Language Modeling
• Summary
• What works
• State-of-the-art retrieval effectiveness
• Relation to the learning-based approaches
3
What is Information Retrieval (IR)?
• Task: To find a few among many
• It is probably motivated by the situation of information overload and
acts as a remedy to it
• When defining IR, we need to be aware that there is a broad sense
and a narrow sense
4
Broad Sense of IR
• It is a discipline that finds information that people want
• The motivation behind would include
• Humans’ desire to understand the world and to gain knowledge
• Acquire sufficient and accurate information/answer to accomplish a task
• Because finding information can be done in so many different ways, IR would involve:
• Classification (Wednesday lecture by Fraizio Sabastiani and Alejandro Mereo))
• Clustering
• Recommendation
• Social network
• Interpreting natural languages (Wednesday lecture by Fraizio Sabastiani and Alejandro Mereo))
• Question answering
• Knowledge bases
• Human-computer interaction (Friday lecture by Rishabh Mehrotra)
• Psychology, Cognitive Science, (Thursday lecture by Joshua Kroll), …
• Any topic that listed on IR conferences such as SIGIR/ICTIR/CHIIR/CIKM/WWW/WSDM…
5
Narrow Sense of IR
• It is ‘search’
• Mostly searching for documents
• It is a computer science discipline that designs and implements
algorithms and tools to help people find information that they want
• from one or multiple large collections of materials (text or multimedia,
structured or unstructured, with or without hyperlinks, with or without
metadata, in a foreign language or not – Monday Lecture Multilingual IR by
Doug Oard),
• where people can be a single user or a group
• who initiate the search process by an information need,
• and, the resulting information should be relevant to the information need
(based on the judgement by the person who starts the search)
6
Narrowest Sense of IR
• It helps people find relevant documents
• from one large collection of material (which is the Web or a TREC collection),
• where there is a single user,
• who initiates the search process by a query driven by an information need,
• and, the resulting documents should be ranked (from the most relevant to the
least) and returned in a list
7
Players in Information Retrieval
Corpus
Information
User Metric
Need
Results
8
A Brief Historical Line of Information Retrieval
8
0
1940s 1950s 1960s 1970s 1980s 1990s 2000 2005 2010 2015 2020
Memex Vector Space Model Probabilistic Theory Okapi BM25 TREC LM
Learning to Rank Deep Learning QA Filtering Query User
9
Relationships to Sister Disciplines
Solid line: transformations or special cases
Dashed line: overlap with
AI
Recommendation
Non-exhaustive search
Human issued queries;
DB Supervised
file
tab
pro
ul a
Un ted d ata ML
ser
str
u
da
ta; i ng
in da
ta
tu
ctu t ra n g
Bo of i ni
bu
red ol e e ra
s ot
da ;u
ry
ta; an n ; n
ue
qu e el s
NL eri d riv d
q
es ta - o
q dm
No
ue
rie Da t e
s -c raf
er t
Ex p
Understanding of data; Semantics Large scale; use of algorithms Library
NLP IR
Controlled vocabulary; browsing
Science
Loss of semantics; only counting terms
Inter
nts activ
e cted
User-centered study
cu m a e; co
o t r mple
a d of d e rs ex Singl x info
ste w e ite rmat
e rs in re a ns ratio
n ion n
nsw o eed
s a e p bef s
urn e st
Ret d i at
te rme
In Information
QA Seeking; IS
HCI 10
Outline
• What is Information Retrieval
• Task, Scope, Relations to other disciplines
• Process
• Preprocessing, Indexing, Retrieval, Evaluation, Feedback
• Retrieval Approaches
• Boolean
• Vector Space Model
• BM25
• Language Modeling
• Summary
• What works
• State-of-the-art retrieval effectiveness
• Relations to the learning-based approaches
11
Process of Information Retrieval
Information Document
Need Representation Corpus
Retrieval
Models Index
Retrieval Results
Evaluation/
Feedback
12
Terminology
• Query: text to represent an information need
• Document: a returned item in the index
• Term/token: a word, a phrase, an index unit
• Vocabulary: set of the unique tokens
• Corpus/Text collection
• Index/database: index built for a corpus
• Relevance feedback: judgment from human
• Evaluation Metrics: how good is a search system?
• Precision, Recall, F1
13
Document Retrieval Process
Information Document
Need Representation Corpus
Indexing
Query Representation
Querying Retrieval
Models Index
Retrieval Results
Evaluation/
Feedback
14
From Information Need to Query
Get rid of mice in a politically
TASK
correct way
Verbal form
How do I trap mice alive?
15
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma. Chap 1
Document Retrieval Process
Information Document
Need Representation Corpus
Indexing
Query Representation
Retrieval
Models Index
Indexing
Retrieval Results
Evaluation/
Feedback 16
Sec. 1.2
Linguistic modules
friend roman countryman
Normalized tokens
Indexer friend 2 4
roman 1 2
Inverted index
countryman 13 17 16
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma. Ch 1
Sec. 1.2
An Index
• Sequence of (Normalized token, Document ID) pairs.
Doc 1 Doc 2
18
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma. Chap 1
Document Retrieval Process
Information Document
Need Representation Corpus
Retrieval
Models Index
Retrieval Results
Evaluation Evaluation/
Feedback 19
Evaluation
• Implicit (clicks, time spent) vs. Explicit (yes/no, grades)
• Done by the same user or by a third party (TREC-style)
• Judgments can be binary (Yes/No) or graded
• Assuming ranked or not
• Dimensions under consideration
• Relevance (Precision, nDCG)
• Novelty/diversity
• Usefulness
• Effort/cost
• Completeness/coverage (Recall)
• Combinations of some of the above (F1), and many more
• Relevance is the main consideration. It means
• If a document (a result) can satisfy the information need
• If a document contains the answer to my query
• The evaluation lecture (Tuesday by Nicola Ferror and Maria Maistro) will share much more
20
interesting details
Document Retrieval Process
Information Document
Need Representation Corpus
Retrieval
Algorithms Index
Retrieval
Retrieval Results
Evaluation/
Feedback
21
Outline
• What is Information Retrieval
• Task, Scope, Relations to other disciplines
• Process
• Preprocessing, Indexing, Retrieval, Evaluation, Feedback
• Retrieval Approaches
• Boolean
• Vector Space Model
• BM25
• Language Modeling
• Summary
• What works
• State-of-the-art retrieval effectiveness
• Relations to the learning-based approaches
22
How to find relevant documents for a query?
• By keyword matching
• boolean model
• By similarity
• vector space model
• By imaging how to write out a query
• how likely a query is written with this document in mind
• generate with some randomness
• query generation language model
• By trusting how other web pages think about the web page
• pagerank, hits
• By trusting how other people find relevant documents for the same/similar query
• Learning to rank
23
Sec. 1.3
Boolean Retrieval
• Views each document as a set of words
• Boolean Queries use AND, OR and NOT to join query terms
• Simple SQL-like queries
• Sometimes with weights attached to each component
• It is like exact match: document matches condition or not
• Perhaps the simplest model to build an IR system
• Many current search systems are still using Boolean
• Professional searchers who want to under control of the search process
• e.g. doctors and lawyers write very long and complex queries with Boolean
operators
24
Summary: Boolean Retrieval
• Advantages:
• Users are under control of the search results
• The system is nearly transparent to the user
• Disadvantages:
• Only give inclusion or exclusion of docs, not rankings
• Users would need to spend more effort in manually examining the returned
sets; sometimes it is very labor intensive
• No fuzziness allowed so the user must be very precise and good at writing
their queries
• However, in many cases users start a search because they don’t know the answer
(document)
25
Ranked Retrieval
• Often we want to rank results
• from the most relevant to the least relevant
• Users are lazy
• maybe only look at the first 10 results
• A good ranking is important
• Given a query q, and a set of documents D, the task is to rank those
documents based on a ranking score or relevance score:
• Score (q,di) in the range of [0,1]
• from the most relevant to the least relevant
• A lot of IR research is about to determine score (q,di)
26
Vector Space Model
27
Sec. 6.3
28
Sec. 6.3
30
Sec. 6.3
In a space of ‘Jealous’ and ‘Gossip’
Here, if you look at the content (or we say
the word distributions) of each
document, d2 is actually the most similar
document to q
32
Adapted from textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma. Chap 6
Sec. 6.3
Cosine Similarity
35
Answers:
Consider two documents D1, D2 and a query Q
D1 = (0.5, 0.8, 0.3), D2 = (0.9, 0.4, 0.2), Q = (1.5, 1.0, 0)
37
Term Frequency
• How many times a term appears in a document
38
• Some terms are common,
• less common than the stop words
• but still quite common
• e.g. “Information Retrieval” is uniquely important in NBA.com
• e.g. “Information Retrieval” appears at too many pages in SIGIR web site, so it is not a
very important term in those pages.
39
Sec. 6.2.1
40
Sec. 6.2.2
tf-idf weighting
• Product of a term’s tf weight and idf weight regarding a document
41
Sec. 6.4
42
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma. Chap 6
Sec. 6.4
43
Summary: Vector Space Model
• Advantages
• Simple computational framework for ranking documents given a query
• Any similarity measure or term weighting scheme could be used
• Disadvantages
• Assumption of term independence
• Ad hoc
44
BM25
45
The (Magical) Okapi BM25 Model
• BM25 is one of the most successful retrieval models
• It is a special case of the Okapi models
• Its full name is Okapi BM25
• It considers the length of documents and uses it to normalize the
term frequency
• It is virtually a probabilistic ranking algorithm though it looks very ad-
hoc
• It is intended to behave similarly to a two-Poisson model
• We will talk about Okapi in general
46
What is Behind Okapi?
• [Robertson and Walker 94 ]
• A two-Poisson document-likelihood Language model
• Models within-document term frequencies by means of a mixture of two Poisson
distributions
• Hypothesize that occurrences of a term in a document have a random or
stochastic element
• It reflects a real but hidden distinction between those documents which are “about” the concept
represented by the term and those which are not.
• Documents which are “about” this concept are described as “elite” for the term.
• Relevance to a query is related to eliteness rather than directly to term
frequency, which is assumed to depend only on eliteness.
47
Two-Poisson Model
• Term weight for a term t:
48
Characteristics of Two-Poisson Model
• It is zero for tf=0;
• It increases monotonically with tf;
• but to an asymptotic maximum;
• The maximum approximates to the Robertson/Sparck-Jones weight
that would be given to a direct indicator of eliteness.
p = P(term present| R)
q = P(term present| NR)
49
Constructing a Function
• Constructing a function
• Such that tf/(constant + tf) increases from 0 to an asymptotic maximum
• A rough estimation of 2-poisson
constant
tf component of Okapi
50
Okapi Model
• The complete version of Okapi BMxx models
53
Answer: Okapi BM25
56
Using language models in IR
§ Each document is treated as (the basis for) a language model
§ Given a query q, rank documents based on P(d|q)
57
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma.
Query-likelihood LM
Document Query
Language Model Likelihood
d1 θ d1 p (q | q d1 ) q
p(q | q d 2 )
d2 θd2 p(q | q d N )
dN θdN
• Scoring documents with query likelihood
• Known as the language modeling (LM) approach to IR
58
Adapted from Mei, Fang and Zhai‘s “A study of poison query generation model in IR”
A different language model for each document
59
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma.
Binomial Distribution
• Discrete
• Series of trials with only two outcomes, each trial being independent
from all the others
• Number r of successes out of n trials given that the probability of
success in any trial isq :
ænö r
b(r; n, q ) = çç ÷÷q (1 - q ) n - r
èrø
60
Multinomial Distribution
• The multinomial distribution is a generalization of the binomial distribution.
• The binomial distribution counts successes of an event (for example, heads in coin
tosses).
• The parameters:
– N (number of trials)
– q (the probability of success of the event)
• The multinomial counts the number of a set of events (for example, how many times
each side of a die comes up in a set of rolls).
– The parameters:
– N (number of trials)
– q1..q k (the probability of success for each category)
61
Each is estimated by Maximum Likelihood Estimation (MLE)
Multinomial Distribution
• W1,W2,..Wk are variables Number of possible orderings of N balls
N!
P(W1 = n1 ,..., W1 = nk | N , q 1 ,.., q k ) = q1n1q 2 n2 ..q k nk
n1 !n2 !..nk !
model
mining
mining
|V |
p(q | d ) = Õ p( w j | d )
c ( w j ,q )
j =1
63
Adapted from Mei, Fang and Zhai‘s “A study of poison query generation model in IR”
Issue
§ Issue: a single t with P(t|Md) = 0 will make zero
§ Smooth the estimates to avoid zeros
64
Dirichlet Distribution & Conjugate Prior
• If the prior and the posterior are the same distribution, the prior is
called a conjugate prior for the likelihood
Gamma function
65
Dirichlet Smoothing
• Let s say the prior for q1 ,..,q k is
Dir (a1 ,.., a k )
• From observations to the data, we have the following counts n1 ,.., nk
• The posterior distribution for q1 ,..,q k , given the data, is
66
JM Smoothing:
67
Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma.
Poisson Query-likelihood LM
Poisson: Receiver: Query
Each term is written Rates of Duration: |q|
arrival : li
text text [ ] 1
mining 3/7
model mining [ ] 2
2/7
mining model [ / ] 0
text 1/7
clustering clustering [ / ] 0
1/7
text … [ ] 1
…
Query q :
“mining text mining systems”
Slides adapted from Mei, Fang and Zhai‘s “A study of poison query generation model in IR” 68
Comparison
Õ p(w = 1 | d )Õ p(w = 0 | d ) Õ
c ( w j ,q ) |V |
70
Outline
• What is Information Retrieval
• Task, Scope, Relations to other disciplines
• Process
• Preprocessing, Indexing, Retrieval, Evaluation, Feedback
• Retrieval Approaches
• Boolean
• Vector Space Model
• BM25
• Language Modeling
• Summary
• What works?
• State-of-the-art retrieval effectiveness – what should you expect?
• Relations to the learning-based approaches
71
What works?
• Term Frequency (tf)
• Inverse Document Frequency (idf)
• Document length normalization
• Okapi BM25
• Seems ad-hoc but works so well (popularly used as a baseline)
• Created by human experts, not by data
• Other more justified methods could achieve similar effectiveness as
BM25
• They help better deep understanding of IR, related disciplines
72
What might not work?
• You might have heard of other topics/techniques, such as
• Pseudo-relevance feedback
• Query expansion
• N-gram instead of unit gram
• Semantically-heavy annotations
• Sophisticated understanding of documents
• Personalization (Read a lot into the user)
• .. But they usually don’t work reliably (not as much as what we expect
and sometimes worsen the performance)
• Maybe more research needs to be done
• Or, maybe they are not the right directions
73
At the heart is the metric
• How our users feel good about the search results
• Sometimes it could be subjective
• The approaches that we discusses today do not directly optimize the
metrics (P, R, nDCG, MAP etc)
• These approaches are considered more conventional, without making
use of large amount of data that can be learned models from
• Instead, they are created by researchers based on their own
understanding of IR and they hand-crafted or imagined most of the
models
• And these models work very well
• Salute to the brilliant minds
74
Learning-based Approaches
• More recently, learning-to-rank has become the dominating approach
• Due to vast amount of logged data from Web search engines
• The retrieval algorithm paradigm
• Has become data-driven
• Requires large amount of data from massive users
• IR is formulated as a supervised learning problem
• directly uses the metrics as the optimization objectives
• No longer guess what a good model should be, but leave to the data to decide
• The Deep learning lecture (Thursday by Bhaskar Mitra, Nick Craswell,
and Emine Yilmaz) will introduce them in depth
75
References
• IR Textbooks used for this talk:
• Introduction to Information Retrieval. C.D. Manning, P. Raghavan, H. Schütze. Cambridge UP, 2008.
• Foundations of Statistical Natural Language Processing. Christopher D. Manning and Hinrich Schütze.
• Search Engines: Information Retrieval in Practice. W. Bruce Croft, Donald Metzler, and Trevor Strohman. 2009.
• Modern Information Retrieval: The Concepts and Technology behind Search. by Ricardo Baeza-Yates, Berthier Ribeiro-Neto. Second
condition. 2011.
• Main IR research papers used for this talk:
• Some Simple Effective Approximations to the 2-Poisson Model for Probabilistic Weighted Retrieval. Robertson, S. E., & Walker, S.
SIGIR 1994.
• Document Language Models, Query Models, and Risk Minimization for Information Retrieval. Lafferty, John and Zhai, Chengxiang.
SIGIR 2001.
• A study of Poisson query generation model for information retrieval. Qiaozhu Mei, Hui Fang, Chengxiang Zhai. SIGIR 2007.
• Course Materials/presentation slides used in this talk:
• Barbara Rosario’s “Mathematical Foundations” lecture notes for textbook “Statistical Natural Language Processing”
• Textbook slides for “Search Engines: Information Retrieval in Practice” by its authors
• Oznur Tastan s recitation for 10601 Machine Learning
• Textbook slides for “Introduction to Information Retrieval” by Hinrich Schütze and Christina Lioma
• CS276: Information Retrieval and Web Search by Pandu Nayak and Prabhakar Raghavan
• 11-441: Information Retrieval by Jamie Callan
• A study of Poisson query generation model for information retrieval. Qiaozhu Mei, Hui Fang, Chengxiang Zhai
76
Thank You Dr. Grace Hui Yang
InfoSense
Georgetown University, USA
Contact: [email protected]
77