Techniquecore
Jelinek-Mercer smoothing
Also called linear interpolation smoothing.
Smooths a document language model by mixing it with the collection model at a fixed weight lambda.
Jelinek-Mercer smoothing estimates the language model of a document as a fixed mixture of two models: the maximum likelihood model of the document, with weight , and the model of the whole collection, with weight . Every word of the collection then gets a nonzero probability in every document, so the query likelihood model no longer gives to a document that lacks one query word. Frederick Jelinek and Robert Mercer introduced the interpolation in 1980 for speech recognition, with weights learned on held-out data. In retrieval, Zhai and Lafferty showed that it gives the query likelihood score an idf-like weight per word, and measured that the best depends on the length of the queries.
In plain words
A short document is a small sample of words. If we estimate word chances from it alone, every word that it does not contain gets chance zero, and a query with one such word gets chance zero too. That is too harsh: the document may still be about the topic. So we mix two guesses. One guess is the word chances in the document. The other is the word chances in the whole collection, which are never zero for a word that occurs somewhere. We take a fixed share of each, for example half and half, and add them. Words that the document uses often keep high chances. Missing words get a small chance, the same share of their collection chance in every document. A common word then helps a document less than a rare word, because every document gets much of its chance anyway.
When it applies
Use it when an estimate from little data must be combined with a broad estimate from much data, and one fixed weight for all cases is good enough. In retrieval this is the document model of the query likelihood model, the mixture of a feedback model with the query model, and the teleport of a random walk. It needs a background model that gives nonzero probability to every event that can occur, here every query word. It is a weaker choice when the right amount of smoothing depends on how much data each case has, such as documents of very different lengths; then Dirichlet prior smoothing adapts the weight to the length.
The template
JM-SCORE(q, d, λ)- 1
s ← 0 - 2
for each word t of q, with count c(t, q): - 3
p_d ← tf(t, d) / |d| ▷ hole: the sparse estimate - 4
p_C ← cf(t) / |C| ▷ hole: the background model, nonzero for every t - 5
s ← s + c(t, q) · log((1 - λ) · p_d + λ · p_C) ▷ hole: λ, fixed in (0, 1) - 6
return s
The term weight. For a word that lacks, line L5 adds , which is the same for every document. Subtract this from every term of every document. What is left is a sum over the query words that contains:
The second sum is a constant for the query. The weight of a matched word grows with its relative frequency in the document and falls with its collection probability, as a tf-idf weight does. The coefficient of the query likelihood form is for every document, so the length term is the same for all documents and has no effect.
Walk-through on the toy collection. For q1 = "sorted array search", is , and . Document 1 has 9 tokens and each query word once; document 2 has "sorted" twice and "array" once in 10 tokens. With the factor is 1:
| document | sorted | array | search | sum of weights | score |
|---|---|---|---|---|---|
| 1 | 1.0136 | 1.3676 | 1.6843 | 4.0656 | -7.7210 |
| 2 | 1.4255 | 1.2902 | none | 2.7157 | -9.0709 |
The constant is , the score of documents 3, 5 and 6, which hold no query word. The full scores for three values of :
| document | 1 | 2 | 8 | 7 | 4 | 3, 5, 6 |
|---|---|---|---|---|---|---|
| -6.7841 | -10.0257 | -10.6855 | -13.0162 | -13.8923 | -16.6149 | |
| -7.7210 | -9.0709 | -9.5486 | -10.1872 | -10.8388 | -11.7866 | |
| -8.3454 | -9.1655 | -9.5046 | -9.7866 | -10.2601 | -10.7772 |
The order is the same for all three. What changes is the gap. At , document 1, the only one with all three words, leads document 2 by 3.24; at the lead is 0.82. A small rewards documents that hold all the query words, and a large lets one frequent word count about as much as several words once each.
Classic examples
- Query likelihood model. The document model is mixed with the collection model, as in the template. Zhai and Lafferty measured on TREC collections that short title queries do best with near 0.1 and long queries with near 0.7. Their explanation is that long queries hold many common words, and a large lowers the weight of those words more.
- Relevance model. RM3 mixes the term distribution estimated from feedback documents with the original query model at a fixed weight, and Lavrenko and Croft smoothed the document models inside the relevance model with this interpolation.
- PageRank and Markov chain rank aggregation. The teleport step mixes the transition distribution of each state with the uniform distribution at a fixed weight. The mixture makes every transition possible, which gives a unique stationary distribution, just as mixing with the collection model makes every word possible.
- Rocchio algorithm. The new query is a fixed linear combination of the old query and the centroids of the judged documents, an interpolation of vectors instead of distributions.
Variations
- Deleted interpolation. Jelinek and Mercer estimated the weights on held-out data, which is an expectation-maximization problem: each held-out word is explained by one of the two models, and the weight is the expected share of words explained by the document model.
- A weight that depends on the length. Making larger for short documents and smaller for long ones gives Dirichlet prior smoothing, where .
- Several levels. Interpolate the document model with a model of its cluster or its topic and then with the collection model, with one weight per level.
- Two-stage smoothing. Zhai and Lafferty first smooth the document with a Dirichlet prior and then interpolate the result with a model of the query background, with weights estimated from the data.
- N-gram models. In speech and text models, a trigram estimate is mixed with bigram and unigram estimates in the same way, which is the original use.
Pitfalls
- The meaning of . Zhai and Lafferty put on the collection model, as here; Manning, Raghavan and Schütze put it on the document model. A value of 0.1 means little smoothing in one book and much in the other. State the convention.
- The ends of the range. With there is no smoothing and every document without a query word scores . With every document has the same model and the same score. Keep strictly between 0 and 1.
- Words that the collection lacks. If , line L5 takes the log of 0 for every document. Drop such words from the query, or give the background model a floor.
- No length correction. With a fixed , a long document and a short one with the same relative frequency of a word get the same weight, though the estimate from the long document is more reliable. If your collection mixes short and long documents, compare with Dirichlet smoothing.
- Tuning on the test queries. The best depends on the collection and on the kind of query. A value tuned on the test queries makes the results look better than they will be on new queries.
Exercises
- Show that the scores of the template and the sum of the matched term weights give the same ranking for every query. Hint: the difference is the constant .
- Show that as , if there are no ties, the ranking tends to the order by . Hint: , and the factor is the same for all documents.
- On the toy collection with , document 1 gets the weight 1.6843 for "search" and document 7 gets 1.5994 for the same word with . Why? Answer: document 1 has 9 tokens and document 7 has 10, so the relative frequency is against .
References
- Frederick Jelinek and Robert L. Mercer, Interpolated estimation of Markov source parameters from sparse data, in E. S. Gelsema and L. N. Kanal (editors), Pattern Recognition in Practice, North-Holland (1980), the interpolation of a sparse estimate with a more general one, with weights estimated on held-out data
- Chengxiang Zhai and John Lafferty, A study of smoothing methods for language models applied to information retrieval, ACM Transactions on Information Systems 22(2) (2004), 179-214, Jelinek-Mercer smoothing of document models for retrieval, its term weight, and the measured best values of lambda, near 0.1 for title queries and near 0.7 for long queries
- Christopher D. Manning, Prabhakar Raghavan and Hinrich Schuetze, Introduction to Information Retrieval, Cambridge University Press, 2008, Chapter 12, Section 12.2.2 (the linear interpolation of the document model with the collection model, where lambda weights the document side)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag ZBH2C6 Edit this page History Report an error Markdown