IR Models
IR Models
Jian-Yun Nie
Main IR processes
Lastlecture: Indexing – determine the
important content terms
Discussion
◦ Simplistic representation of documents and queries
◦ The ranking score strongly depends on the term
weighting in the document
If the weights are not normalized, then there will be
great variations in R
6
IR model - Boolean model
◦ Document = Logical conjunction of keywords (not
weighted)
◦ Query = any Boolean expression of keywords
◦ R(D, Q) = D Q
7
Properties
Desirable
◦ R(D,Q∧Q)=R(D,Q∨Q)=R(D,Q)
◦ R(D,D)=1
◦ R(D,Q∨¬Q)=1
◦ R(D,Q∧¬Q)=0
Undesirable
◦ R(D,Q)=0 or 1
Boolean model
Strengths
◦ Rich expressions for queries
◦ Clear logical interpretation (well studied logical properties)
Each term is considered as a logical proposition
The ranking function is determine by the validity of a logical implication
Problems:
◦ R is either 1 or 0 (unordered set of documents)
many documents or few/no documents in the result
No term weighting in document and query is used
◦ Difficulty for end-users for form a correct Boolean query
E.g. documents about kangaroos and koalas
kangaroo koala ?
kangaroo koala ?
Specialized application (Westlaw in legal area)
A possible Evaluation:
R(D, ti) = ti(D) ∈ [0,1]
R(D, Q1 Q2) = Q1Q2 (D) = min(R(D, Q1), R(D, Q2));
10
Recall on fuzzy sets
Classical set
◦ a belongs to a set S: a∈S,
◦ or no: a∉S
Fuzzy set
◦ a belongs to a set S to some degree
(μS(a)∈[0,1])
◦ E.g. someone is tall
1.5
μtall(a)
1
0.5
0
1.5 1.7 1.9 2.1 2.3
Recall on fuzzy sets
Combination of concepts
1.2
0.8
Tall
0.6 Strong
Tall&Strong
0.4
0.2
0
Allan Bret Chris Dan
Extension with fuzzy sets
Can take into account term weights
Fuzzy sets are motivated by fuzzy concepts in
natural language (tall, strong, intelligent, fast, slow,
…)
Evaluation reasonable?
◦ min and max are determined by one of the elements (the
value of another element in some range does not have a
direct impact on the final value) - counterintuitive
◦ Violated logical properties
μA∨¬A(.)≠1
μA∧¬A(.)≠0
Alternative evaluation in fuzzy sets
R(D, ti) = ti(D) ∈ [0,1]
R(D, Q1 Q2) = R(D, Q1) * R(D, Q2);
R(D, Q1 Q2) = R(D, Q1) + R(D, Q2) - R(D, Q1) * R(D, Q2);
R(D, Q1) = 1 - R(D, Q1).
t3 D
(ai * bi )
Cosine
i
Sim( D, Q)
Q
i
ai 2 * i
bi 2 θ
t1
(a * b )
2 i i
Dice Sim( D, Q) i t2
a b
i
i
2
i
i
2
Jaccard
(a * b ) i
i i
Sim( D, Q)
a b (a * b )
i
i
2
i
i
2
i
i i
17
Document-document, document-query
and term-term similarity
t1 t2 t3 … tn
D1 a11 a12 a13 … a1n D-D similarity
d d i ,k
n 2
d j dk i 1 i, j
Stored as:
D1 {(t1, a1), (t2,a2), …}
t1 {(D1,a1), …}
20
Implementation (time)
The implementation of VSM with dot product:
◦ Naïve implementation: Compare Q with each D
◦ O(m*n): m doc. & n terms
◦ Implementation using inverted file:
Given a query = {(t1,b1), (t2,b2), (t3,b3)}:
1. find the sets of related documents through inverted file for each term
2. calculate the score of the documents to each weighted query term
(t1,b1) {(D1,a1*b1), …}
3. combine the sets and sum the weights () (in binary tree)
◦ O(|t|*|Q|*log(|Q|)):
|t|<<m (|t|=avg. length of inverted lists),
|Q|*log|Q|<<n (|Q|=length of the query)
21
Pre-normalization
Cosine:
(a * b ) i i
ai bi
Sim ( D, Q) i
a *b a b
2 2 2 2
i
i i j j
j j j j
User Query
Understanding
Information Need Representation of user need is
uncertain
How to match?
Uncertain guess of
Document whether document has
Documents Representation
relevant content
Prior
Posterior
Odds:
Probability Ranking Principle
Constant for a
Needs estimation
given query
• So :
Binary Independence Model
n
p ( xi | R, q )
O ( R | q, d ) O ( R | q )
i 1 p ( xi | NR, q )
• Since xi is either 0 or 1:
p( xi 1 | R, q) p( xi 0 | R, q)
O ( R | q, d ) O ( R | q )
xi 1 p( xi 1 | NR, q) xi 0 p( xi 0 | NR, q)
• Let pi p ( xi 1 | R, q ); ri p ( xi 1 | NR, q );
pi (1 ri ) 1 pi
O ( R | q, x ) O ( R | q )
xi qi 1 ri (1 pi ) qi 1 1 ri
Constant for
each query
pi (1 ri ) pi (1 ri )
RSV log log
xi qi 1 ri (1 pi ) xi qi 1 ri (1 pi )
Binary Independence Model
• All boils down to computing RSV.
pi (1 ri ) pi (1 ri )
RSV log log
xi qi 1 ri (1 pi ) xi qi 1 ri (1 pi )
pi (1 ri )
RSV ci ; ci log
xi qi 1 ri (1 pi )
s (n s )
p
• Estimates: i ri
S (N S)
s (S s)
ci K ( N , n, S , s ) log Sparck-
(n s) ( N n S s)
Jones-
Robertson
formula
Estimation – key challenge
If non-relevant documents are approximated by the
whole collection, then ri (prob. of occurrence in non-
relevant documents for query) is n/N and
◦ log (1– ri)/ri = log (N– n)/n ≈ log N/n = IDF!
pi(probability of occurrence in relevant documents)
can be estimated in various ways:
◦ from relevant documents if know some
Relevance weighting can be used in feedback loop
◦ constant (Croft and Harper combination match) – then just
get idf weighting of terms
◦ proportional to prob. of occurrence in collection
more accurately, to log of this (Greiff, SIGIR 1998)
Iteratively estimating pi
1. Assume that pi constant over all xi in query
◦ pi = 0.5 (even odds) for any given doc
2. Determine guess of relevant document set:
◦ V is fixed size set of highest ranked documents on this
model (note: now a bit like tf.idf!)
3. We need to improve our guesses for pi and ri, so
◦ Use distribution of xi in docs in V. Let Vi be set of
documents containing xi
pi = |Vi| / |V|
◦ Assume if not retrieved then not relevant
ri = (ni – |Vi|) / (N – |V|)
4. Go to 2. until converges then return ranking
46
Probabilistic relevance feedback
If user has told us some relevant and some
irrelevant documents, then we can proceed to
build a probabilistic classifier, such as a Naive
Bayes model:
◦ P(tk|R) = |Drk| / |Dr|
◦ P(tk|NR) = |Dnrk| / |Dnr|
tk is a term; Dr is the set of known relevant
documents; Drk is the subset that contain tk; Dnr is
the set of known irrelevant documents; Dnrk is the
subset that contain tk.
Probabilistic Relevance
Feedback
1. Guess a preliminary probabilistic description of
R and use it to retrieve a first set of documents V,
as above.
2. Interact with the user to refine the description:
learn some definite members of R and NR
3. Reestimate pi and ri on the basis of these
◦ Or can combine new information with original guess
(use Bayesian prior): | Vi | pi(1) κ is
pi
( 2)
| V | prior
weight
4. Repeat, thus generating a succession of
approximations to R.
PRP and BIR
Getting reasonable approximations of
probabilities is possible.
Requires restrictive assumptions:
◦ term independence
◦ terms not in query don’t affect the outcome
◦ Boolean representation of
documents/queries/relevance
◦ document relevance values are independent
Some of these assumptions can be removed
Problem: either require partial relevance information or only
can derive somewhat inferior term weights
Removing term independence
In general, index terms aren’t
independent
Dependencies can be complex
van Rijsbergen (1979)
proposed model of simple tree
dependencies
Each term dependent on one
other
In 1970s, estimation problems
held back success of this model
Food for thought
Think through the differences between
standard tf.idf and the probabilistic
retrieval model in the first iteration
Think through the retrieval process of
probabilistic model similar to vector space
model
Good and Bad News
Standard Vector Space Model
◦ Empirical for the most part; success measured by results
◦ Few properties provable
Probabilistic Model Advantages
◦ Based on a firm theoretical foundation
◦ Theoretically justified optimal ranking scheme
Disadvantages
◦ Making the initial guess to get V
◦ Binary word-in-doc weights (not using term frequencies)
◦ Independence of terms (can be alleviated)
◦ Amount of computation
◦ Has never worked convincingly better in practice
BM25 (Okapi system) – Robertson
et al.
Consider tf, qtf, document length
Doc. length
TF factors
Normalization:
boost short
documents
k1, k2, k3, b: parameters
qtf: query term frequency
dl: document length
avdl: average document length
53
Pivoted document length normalization
(Singhal et al. SIGIR’96)
Document length normalization
◦ Weight(t,D) = tf*idf
◦ Cosine normalization: 1/|D|
◦ Normalizatio by max weight:
0.5+0.5*w(t,D)/max{w(t’,D)}
Document Length Normalization
(Singhal)
Sometimes, additional normalizations e.g. length
to boost longer documents:
Probability
of relevance
slope
pivot
Probability of retrieval
Doc. length
55
Regression models
Extract a set of features from document
(and query)
Define a function to predict the probability
of its relevance
Learn the function on a set of training data
(with relevance judgments)
Probability of Relevance
Document Query
X1,X2,X3,X4
feature vector
Ranking Formula
Probability
of relevance
Regression model (Berkeley – Chen and
Frey)
Relevance Features
Sample Document/Query Feature Vector
Relevance Features
X1 X2 X3 X4 Relevance value
0.0031 -2.406 -3.223 1 1
0.0429 -9.796 -15.55 8 1
0.0430 -6.342 -9.921 4 1
0.0195 -9.768 -15.096 6 0
0.0856 -7.375 -12.477 5 0
relevance
feature log it ( p ) log(1pp )
variable
variables
◦ xi = feature variables
◦ βi=parameters/coefficients
Document Ranking Formula